| |||||||||
The Internet Explorer box model bug is one of the best-known 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 is not affected in its standards-compliant mode, only in its "quirks mode". The bug does not affect versions of the browser on the Apple Macintosh platform.
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 paragraphs and block-quotations—to be surrounded by padding, borders, and margins. According to the specification for CSS published by the World Wide Web Consortium, when a width is explicitly specified for any block-level element it should determine only the width of the content within the box, with the padding, borders and margins added afterwards. Internet Explorer incorrectly includes the padding and borders withing the specified width, resulting in a narrower box when displayed.
Various work-arounds have been devised to force Internet Explorer to display pages correctly. These work-arounds generally exploit other bugs in Internet Explorer's