4 ms·
As it's been said in the comments, it's amazing that after years of lobbying IE to change its box model to match W3C, we realize that maybe IE's model made more
by tambourine_man 15y ago
As it's been said in the comments, it's amazing that after years of lobbying IE to change its box model to match W3C, we realize that maybe IE's model made more sense after all.
- agscala 15y agoPeople were lobbying for IE to change in order to make it consistent with the rest of the browsers, not necessarily because it was worse.
- tambourine_man 15y agoYeah, but why not lobby W3C to change their box model to a saner one?
- davej 15y agoThat's what `box-sizing: border-box` is! You can't just change the default because that would break existing websites and the W3C's box model was adopted by every other browser.
- rmc 15y agoSure you can change the existing default, that's what people wanted IE to do.
- davej 15y agoIf individual vendors mess up when implementing the spec from the standards body (which they are a member of) then they should have to clean up their own mess. IE did eventually change the default in IE6 and added quirks mode for compatibility with websites designed for <IE6. Even if the majority of people preferred the IE5.5 box model, it didn't follow the spec and it is therefore wrong. We have standards specifications on the web to maintain cross-browser compatibility; if browser vendors don't follow them then whats the point?
- tambourine_man 15y agoEven if the majority of people preferred the IE5.5 box model, it didn't follow the spec and it is therefore wrong Specs should standardize what's generally considered a good idea. They are not written in stone and have no value in and on itself. If IE's old model was consensually better (and I'm not sure it was), the spec should have changed, not the other way around. After all these years writing CSS, I'm very biased and it's hard to evaluate which is better. I was aware of border-box, but I thought it was Webkit only. Though I probably won't make the switch altogether, I'm glad to know we have a choice.
- funkah 15y agoPoints to TFA
- rplnt 15y agoI think IE worked this way only if there was no DOCTYPE. Or am I mistaking this with some other IE "bug"?
- alexchamberlain 15y agoYeah, it was quirks mode.
- rquantz 15y agoPrior to IE6 it worked this way all the time. That's why quirks mode was there in later versions.
- talmand 15y agoI've felt for years that the "broken" IE model made more sense. Your element has a height and width, padding pushes inward against interior content and margin pushes outward against exterior content. Glad to see others think this too, I always thought it was just me.
- redthrowaway 15y ago>padding pushes inward against interior content and margin pushes outward against exterior content. That actually seems the wrong way round to me. If you think about a document, the margin is what separates text from the edge of the page (or interior padding, if you will). Padding, to me, implies an area around an element that other elements can't touch.
- mikaelgramont 15y agoYes, you're right, that makes more sense. Now let's never bring this up ever again for fear of confusing people some more.
- talmand 15y agoNo, you're looking at it the wrong way. What you call the paper's margin is actually the paper's padding. Or better yet, when you are setting the margin of a document you are actually setting the margin of all the text on the document to the defined width.
- yuhong 15y agoFYI: http://hsivonen.iki.fi/almost-precedent/ http://hsivonen.iki.fi/almost-precedent/
- masklinn 15y ago> it's amazing that after years of lobbying IE to change its box model to match W3C, we realize that maybe IE's model made more sense after all. Not really. Everybody I've known (in about a decade) has felt the IE box model made more sense. But here's the thing: it wasn't the standard, the standard was not going to change its default box model, and dealing with a single slightly worse box model would always be better than dealing with two completely different box models. box-sizing is the alternative, and a pretty good one. But I don't think anyone ever read about the differences between the W3C box model and the MSIE box model and thought "wow, the W3C box model makes so much more sense".