Search: in
Internet Explorer box model bug
Internet Explorer box model bug Encyclopedia
  Tutorials     Encyclopedia     Dictionary     Directory  
Internet_Explorer_box_model_bug Email this to a friend      Internet_Explorer_box_model_bug

Internet Explorer box model bug

The above image demonstrates differences between the content (red) and border (blue) box models.
The above image demonstrates differences between the content (red) and border (blue) box models.
The Internet Explorer box model bug is one of the best-known software bugs in a popular implementation of Cascading Style Sheets (CSS). It affects CSS-aware versions of Microsoft?s Internet Explorer Web browser for Windows up to version six. Internet Explorer 6 and newer are not affected in their standards-compliant mode; they are affected only in ?quirks mode?. The bug did not affect Internet Explorer for Mac on the Apple Macintosh platform, although development for it ended in 2003.

Contents


Bug

The CSS box model describes how certain elements of Web pages are displayed by graphical browsers. The box model allows block-level elements?such as p and blockquote?to be surrounded by padding, borders, and margins. According to the CSS1 specification, released by the World Wide Web Consortium (W3C) in 1996 and revised in 1999, when a width or height is explicitly specified for any block-level element, it should determine only the width or height of the content within the box, with the padding, borders, and margins applied afterward. [1][2] Internet Explorer 5 incorrectly includes the padding and borders within a specified width or height; this results in a narrower or shorter rendering of a box.[3]

Workarounds

Internet Explorer versions 6 and 7 are not affected by the bug if the page contains certain HTML document type declarations. These versions maintain the buggy behavior when in quirks mode for reasons of backward compatibility.[4] For example, quirks mode is triggered:

  • When the document type declaration is absent or incomplete;
  • When an HTML 3 or earlier document is encountered;
  • When an HTML 4.0 Transitional or Frameset document type declaration is used and a system identifier (URI) is not present;
  • When an SGML comment or other unrecognized content appears before the document type declaration, or if there are errors elsewhere in the document;
  • Internet Explorer 6 also uses quirks mode if there is an XML declaration prior to the document type declaration.[5]

Various workarounds have been devised to force Internet Explorer versions 5 and earlier to display Web pages correctly. These workarounds generally exploit unrelated bugs in Internet Explorer?s CSS selector processing in order to hide certain rules from the browser. The best known of these workarounds is the ?box model hack? developed by Tantek Çelik. Çelik developed this idea during his time at Microsoft while working on Internet Explorer for the Macintosh, which is not affected by the bug. It involves specifying a width declaration for Internet Explorer for Windows, and then overriding it with another width declaration for CSS-compliant browsers. This second declaration is hidden from Internet Explorer for Windows by exploiting other bugs in the way that that browser parses CSS rules. The implementation of these CSS ?hacks? has been further complicated by the public release of Internet Explorer 7, which has had some issues fixed, but not others.[4]

Box model hacks have proven unreliable because they rely on bugs in browsers? CSS support that may be fixed in later versions. For this reason, some Web developers have instead recommended either avoiding specifying both width and padding for the same element or using conditional comment and/or CSS filter to work around the box model bug in older versions of Internet Explorer.[6][7]

Support for Internet Explorer's box model

Web design professionals Douglas Bowman and Ethan Marcotte have stated that the original Internet Explorer box model actually represents a better, more logical approach based on common sense.[8][9] An example given by Peter-Paul Koch is a physical, real-world box, whose dimensions always refer to the box itself, including potential padding, but never its content.[10] In CSS designs, this definition allows the exact application of both relative dimensions and absolute padding to any given box, which is not possible with the W3C model without workarounds.[11] Peter-Paul Koch also says that this box model is more useful for graphic designers, who create designs based on the visible width of boxes rather than the supposed width of their content.[12] Another argument, given by Bernie Zimmermann in support of the Internet Explorer box model, is its closeness to the definition of cell dimensions and padding in the HTML table model, as defined by the W3C and implemented in most browsers.[13]

In some early CSS3 Box Model Specification and Basic User Interface Module drafts, the W3C considered an explicit choice of box models via proposed box-width and box-height properties. These are not included in the current CSS3 draft.

References

  1. a b "Pages authored under non-strict mode (quirks) will not change behavior in IE7 and will not be affected by broken CSS filters.Pages authored under non-strict mode (or ?quirks mode?) will not change behavior in IE7."
  2. "The following examples show how to use the !DOCTYPE declaration to specify the DTD a document conforms to, and to switch Internet Explorer 6 and later to standards-compliant mode."
  3. Vorsprung durch Webstandards | Douglas Bowman declares his love to CSS ?
  4. Vorsprung durch Webstandards | Ethan Marcotte declares his love to CSS ?
  5. CSS2 - Box model tweaking
  6. CSS Box Model
  7. Vorsprung durch Webstandards | Peter-Paul Koch declares his love to CSS ?
  8. Box Model Enlightenment, Bernie Zimmermann

External links

es:Internet Explorer box model bug pl:Internet Explorer box model bug





Source: Wikipedia | The above article is available under the GNU FDL. | Edit this article



Related Links in Internet Explorer box model bug

Search for Internet Explorer box model bug in Tutorials
Search for Internet Explorer box model bug in Encyclopedia
Search for Internet Explorer box model bug in Dictionary
Search for Internet Explorer box model bug in Open Directory
Search for Internet Explorer box model bug in Store
Search for Internet Explorer box model bug in PriceGig


Help build the largest human-edited directory on the web.
Submit a Site - Open Directory Project - Become an Editor

Advertisement

Advertisement



Internet Explorer box model bug
Internet_Explorer_box_model_bug top Internet_Explorer_box_model_bug

Home - Add TutorGig to Your Site - Disclaimer

©2008-2009 TutorGig.com. All Rights Reserved. Privacy Statement