Jump to content

Css Box Model In Internet Explorer


skaterdav85

Recommended Posts

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

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...