3 ms·
Surprised it didn't talk about how the box models worked orginally. IE 5 did the box model differently including margin and padding in the width. Made CSS ve
by limeblack 9y ago
Surprised it didn't talk about how the box models worked orginally. IE 5 did the box model differently including margin and padding in the width. Made CSS very difficult to use.
- lojack 9y agoYou can switch to that model using "box-sizing: border-box", and thats the default for bootstrap and a lot of frameworks these days. I actually much prefer that to what ended up being the default, but maintaining a stylesheet that had to account for the two different models was a big pain.
- freshyill 9y agoIt was wrong, and required stupid workarounds, but it was better. I hated those old IEs as much as anybody, but I admitted even back then that IE's broken box model was much saner. We had to do stupid things with widths and percentages just to make the browsers that worked correctly work. The fact that everybody uses box-model: border-box now is pretty much an admission that the original box model was a bad idea.
- wwweston 9y agoAgree with everything... except the idea that IE was wrong in this case. I hated Microsoft as much as anybody during the overlong era of IE6, but even back then, I had to admit that the W3C were the ones who got the box model wrong. The funny thing is that I've never heard any rationale -- much less a convincing rationale -- for the choice in the spec.
- freshyill 9y agoWell only wrong in that they weren't following the W3C box model spec. That single inconsistency was responsible for at least 50% of the extra work caused by IE.
- freshyill 9y agoEdit: I meant box-sizing.
- freshyill 9y agoEdit: I meant box-sizing.