Your main issue is with the usage of inline-block
, which actually adds about 4px worth of space to the left. To remove this, either add -4px
to your margins for the element, or as brouxhaha suggested, you can set the font-size to zero for the parent, and then reset it to whatever value you desire for the .button
elements.
If you want more information regarding the inline-block issue, check this question I answered a few months ago: CSS Inline-block Dimension Discrepancies