gbhall gbhall - 5 days ago 7
CSS Question

Simple CSS issue: Text wont center in a button

In Firefox 'A' shows in the middle, on Chrome/IE it doesn't:

<button type="button" style="width:24px; text-align:center; vertical-align:middle">A</button>


Note the following has the same results:

<button type="button" style="width:24px;">A</button>


Edit: Now seems to be fixed in Chrome 5.0

Answer

Testing this in Chrome, you need to add

padding: 0px;

To the CSS.

Comments