3 ms·
umm ok but why not box-sizing? html{box-sizing:border-box} *,:after,:before{box-sizing:inherit}
by andreapaiola 11y ago
umm ok but why not box-sizing?
html{box-sizing:border-box}
*,:after,:before{box-sizing:inherit}
- chrismorgan 11y agoPersonally I think a much better question is why change the box-sizing? I’d call it out of scope for something like this. Very seldom have I encountered a situation where I actually want border-box rather than content-box; there are normally better ways of doing things. (Truth to tell, I’ve wanted padding-box more often than border-box in recent times, but only Firefox supports it.) Ideally calc() can be used too; it’s more powerful and expressive and well supported nowadays. The last piece of the puzzle to make it all fit together well on more complex arrangements is CSS variables, but they’re only available in Firefox at present. http://caniuse.com/#feat=css-variables,calc http://caniuse.com/#feat=css-variables,calc
- andreapaiola 11y agoAs you say... browser support, but also is more concise. And personally I love the other box-sizing :)
- alwillis 11y agoPersonally I think a much better question is why change the box-sizing? Because the default content-box is a pain in the ass to work with, so to be able to use border-box all the time is a good thing: http://www.paulirish.com/2012/box-sizing-border-box-ftw/ http://www.paulirish.com/2012/box-sizing-border-box-ftw/.