Below is the code, two buttons in one div.
<div style="position:relative; width: 300px; height: 30px; border: 1px solid;">
<input type="button" value="ok" style="position:relative; width: 70px; height: 30px;">
<input type="button" value="ok" style="position:relative; width: 70px; height: 30px;">
</div>
How to horizontally center the buttons in fixed sized did ?
Adding
text-align:center;CSS to the<div>will center the buttons. You should also consider separating the style from the content, which amongst other reasons, reduces the duplication. For exampleCSS
HTML
Edit: The official definition for
text-alignstates:so it will centre all inline level elements and
<input>is an inline element.