Content deleted Content added
→Specifics: Total height had width in formula where it was supposed to be height. Tags: Mobile edit Mobile web edit |
Tom.Reding (talk | contribs) m Enum 3 author/editor WLs; WP:GenFixes on |
||
Line 1:
{{Use dmy dates|date=July 2019}}
{{multiple issues|
{{
{{primary sources|date=September 2017}}
{{more citations needed|date=September 2017}}
Line 21:
==Specifics==
The Cascading Style Sheets (CSS) specification describes how elements of [[web page]]s are displayed by graphical browsers. Section 4 of the CSS1 specification defines a "formatting model" that gives block-level elements—such as <code>p</code> and <code>blockquote</code>—a width and height, and three levels of boxes surrounding it: padding, borders, and margins.<ref name="CSS-19990111">{{cite web |url=https://www.w3.org/TR/1999/REC-CSS1-19990111#formatting-model |title=Cascading Style Sheets, level 1 § Formatting model |last1=Wium Lie |first1=Håkon |author-link1=Håkon Wium Lie |last2=Bos |first2=Bert |author-link2=Bert Bos |date=11 January 1999 |publisher=[[World Wide Web Consortium]] |access-date=26 October 2017}}</ref> While the specification never uses the term "
All HTML elements can be considered "boxes", this includes <code>div</code> tag, <code>p</code> tag, or <code>a</code> tag. Each of those boxes has five modifiable dimensions:
:*the <code>height</code> and <code>width</code> describe dimensions of the actual content of the box (text, images, ...)
Line 30:
:*the <code>margin</code> is the space around the border
According to the CSS1 specification, released by 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 visible element, with the padding, borders, and margins applied afterward.<ref name="CSS-19990111" /><ref>{{Cite web| url=http://www.w3.org/TR/REC-CSS1-961217#formatting-model | title= Cascading Style Sheets, level 1 | author=
The total width of a box is therefore <code>left-margin</code> + <code>left-border</code> + <code>left-padding</code> + <code>width</code> + <code>right-padding</code> + <code>right-border</code> + <code>right-margin</code>. Similarly, the total height of a box equals <code>top-margin</code> + <code>top-border</code> + <code>top-padding</code> + <code>height</code> + <code>bottom-padding</code> + <code>bottom-border</code> + <code>bottom-margin</code>.
Line 68:
[[Internet Explorer]] in "[[quirks mode]]" includes the content, padding and borders within a specified width or height; this results in a narrower or shorter rendering of a box than would result following the standard behavior.<ref>{{Cite web| url=http://msdn2.microsoft.com/en-us/library/bb250395.aspx#cssenhancements_topic3 | title=CSS Enhancements in Internet Explorer 6 | author=Lance Silver |date=March 2001 | publisher=[[Microsoft]] | work=[[Microsoft Developer Network]] | accessdate=2007-06-24}}</ref>
The ''Internet Explorer box model'' behavior was often considered a bug, because of the way in which earlier versions of [[Internet Explorer]] handle the
===Workarounds===
|