I have been puzzling over where to put the submit button, on the left or the right. In researching, I noticed that many sites put buttons on the bottom right in dialogue boxes, and on the bottom left in forms.
It makes sense: in a dialogue box it seems to denote finality, being in the endpoint of the window for left–right readers; in a form, the bottom right could be in a different position relative to the rest of the form if the window is resized.
It seems to be a convention, but should the OK/Cancel buttons be aligned right or centered?
Should the OK/Cancel buttons be aligned right or centered?
There are pros and cons to either side, but in the end I think the answer is to trust the instincts of the designer, or their specific use case.
The key considerations are the form’s complexity, the number of actions, and the user’s expected workflow.

## The Importance of Consistency and User Expectation

Consistency in design is essential for user experience (UX). Users form mental models based on the design elements they encounter
There is no obvious right answer, but designers usually choose a convention: one to follow and one to break. In my case, it was important that neither one was more important than the other, which swayed me to choose to center the buttons, but keep alignment within one group consistent.
In my example, I choose to center the Cancel button in a single row with an X close button to the far right. However, when making a decision to left/center/right align the