I have these HTML and CSS:
you can put in a table cell and then align the cell content.
<table>
<tr>
<td align="center">
<input type="button" value="Some Button">
</td>
</tr>
</table>
To have text-align:center
work you need to add that style to the #siteInfo
div or wrap the input in a paragraph and add text-align:center
to the paragraph.
you can use this two simple line code :
display: block;
margin:auto;
You need to put the text-align:center
on the containing div, not on the input itself.
You can use the following CSS for your input field:
.center-block {
display: block;
margin-right: auto;
margin-left: auto;
}
Then,update your input field as following:
<input class="center-block" type="button" value="Some Button">
You can also use the tag, this works in divs and everything else:
<center><form></form></center>
This link will help you with the tag:
Why is the <center> tag deprecated in HTML?