skaterdav85 Posted September 18, 2011 Share Posted September 18, 2011 According to an article on Nettus, they say that IE implements the box model where if you specify the width of an element and apply padding and a border, the total width will equal the value specified for width and IE will factor in the padding and borders. So, (content area + borders + padding = width).http://net.tutsplus.com/tutorials/html-css-techniques/quick-tip-did-internet-explorer-get-the-box-model-right/ However, on W3 Schools, it says that IE only does this when you don't declare the DOCTYPE.http://www.w3schools.com/css/css_boxmodel.asp Which one is it? I dont have easy access to IE because I use a mac. Link to comment Share on other sites More sharing options...
Ingolme Posted September 18, 2011 Share Posted September 18, 2011 Internet Explorer 6 and above follow the standard box model when a proper DOCTYPE is specified. Link to comment Share on other sites More sharing options...
skaterdav85 Posted September 18, 2011 Author Share Posted September 18, 2011 What do you mean a proper doctype? Would you consider the HTML 5 doctype as proper? Link to comment Share on other sites More sharing options...
Ingolme Posted September 18, 2011 Share Posted September 18, 2011 Yes. The following DOCTYPEs work: HTML 4.01 Strict XHTML 1.0 Transitional XHTML 1.0 Strict HTML 5 There might be some more, but I don't recommend their usage, and I also recommend trying to avoid Transitional if possible. Link to comment Share on other sites More sharing options...
skaterdav85 Posted September 19, 2011 Author Share Posted September 19, 2011 After reading more of the comments on Nettuts, it seems like IE's box model isn't the standard, with a doctype. You sure about that Ingolme?http://net.tutsplus.com/tutorials/html-css-techniques/quick-tip-did-internet-explorer-get-the-box-model-right/ I'm definitely going to try this tomorrow when I have access to a PC. Link to comment Share on other sites More sharing options...
Ingolme Posted September 19, 2011 Share Posted September 19, 2011 That article is talking about Internet Explorer's box model. Internet Explorer uses the standard box model when you apply a proper DOCTYPE declaration. If you don't use a DOCTYPE declaration then Internet Explorer will revert to its own box model. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.