You should be applying box-sizing
, which accounts for padding when computing the width (i.e. 90px
+ 10px
for padding, will apply the padding inwards, rather than creating a total width of 110px
. If you want to be extra safe, add this to your reset or normalise stylesheet:
* { box-sizing: border-box }
For older versions of Safari & Firefox:
* { -webkit-box-sizing: border-box; -moz-box-sizing: border-box }
Using the wildcard selector allows the box-sizing
property to be applied to all elements. I know this is included in some grid systems out there, e.g. Skeleton.