3 ms·
Great story. I have yet to think of a valid reason why "box-sizing: border-box" should not be the default. It goes into every CSS document I've ever written.
by LeoPanthera 12y ago
Great story. I have yet to think of a valid reason why "box-sizing: border-box" should not be the default. It goes into every CSS document I've ever written.
- yuhong 12y agoIn fact: https://hsivonen.fi/almost-precedent https://hsivonen.fi/almost-precedent
- bbx 12y agoOne thing I can think of is when you want your inner content to be a specific width while adjusting the padding and borders to fit the layout.
- freshyill 12y agoThen you probably haven't been writing CSS for very long. Its support is quite recent. border-box is a much smarter default, but they'd break a lot of old sites by changing the default behavior.
- LeoPanthera 12y agoCorrect, only a year or two.
- freshyill 12y agoIt's funny—back in the day when IE 6's box-model did it more like this (it was really margin-box, which still doesn't exist and probably never will), I used to say that IE's model, while incorrect was superior. And people would disagree with me vehemently. Now, people swear by border-box, which is much more like the old incorrect IE box-model (for good reasons). But it's funny how anti-IE sentiment overruled common sense.
- bphogan 12y agoIn old IE it was the default. If you didn't use a proper doctype it would behave that way. It's fun how history repeats.