5 ms·
Sounds reasonable, but are there any downsides to consider before adopting... * { box-sizing: border-box; } everywhere...?
by gojomo 14y ago
Sounds reasonable, but are there any downsides to consider before adopting...
* { box-sizing: border-box; }
everywhere...?
- jonespen 14y agoNot according to Paul Irish: http://paulirish.com/2012/box-sizing-border-box-ftw/ http://paulirish.com/2012/box-sizing-border-box-ftw/ The biggest downside is that its only supported in IE8+
- atirip 14y agoIf you use it sparsingly, like on specific div's only - and you can do that, because box-model:border-box only _really_ matters and is _really-really_ good when dealing with percentage widths, you can fix it with 'behaviour' and css calculations. Done that.
- ricardobeat 14y ago1. The * selector is slow 2. No IE < 8 support
- nilliams 14y agoApparently it is not the case that the * selector is slow, see Paul's article. >> You might get up in arms about the universal * selector. Apparently you've heard its slow. Firstly, it's not. It is as fast as h1 as a selector
- garethadams 14y agoIt means that a 300px wide image won't fit inside a 300px wide box any more. You need to decide whether your sizing for each element depends on your layout or your content, and choose accordingly. If one way is more useful to you nearly all of the time, then use it that way. However, also be aware that the star rule is the least performant rule in CSS (http://stackoverflow.com/questions/1714096/why-is-the-css-star-selector-considered-harmful http://stackoverflow.com/questions/1714096/why-is-the-css-st...).
- Hovertruck 14y agoWe use it for the Chartbeat dashboard (demo here: http://chartbeat.com/demo/ http://chartbeat.com/demo/) and it's been delightful, but we also made the decision while we were already doing a redesign. This meant we weren't just adding another rule to the page which would change everything; we wrote new CSS with this concept in mind.