Tired of doing crazy calculations and adding unneeded wrapper divs to keep your web layouts from falling apart? You might want to try using ‘box-sizing’ to declare an alternate box model. Lets you keep padding ‘inside’ your declared container width, instead of adding to the overall width. It even works in IE8+!
Yes, I’m a huge fan. I’ve been using this on all my sites for the past 6 months or so and have had no issues.
* { -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } there’s a polyfill for older ie as well: https://github.com/Schepp/box-sizing-polyfill