Home >Web Front-end >HTML Tutorial >Deviation problem of IE6 positioning box model_html/css_WEB-ITnose
Article source: I Love Maomao Technology Blog
Address: http://www.52maomao.info
I dare not draw any conclusions easily about whether the IE6 box model is different from other browsers , but there seems to be some evidence to prove that the box model of IE6 is different from other browsers.
For example, we are going to talk about the deviation problem of the IE6 positioning box model today.
Position:absolute; and position:relative; in CSS properties are two properties that are often used for positioning layout. When we use position:relative; in the parent element to set it as a positioning tree, we use position:absolute; to position the child element, and set the position of the child element through top, left, right, and bottom.
There is the following situation: we use position:relative; for the parent element and add a padding:20px;, and then we position the child element through position:absolute;.
At this time, there is a problem in IE6. It is not positioned with reference to the edge area of the parent element, but with reference to the edge after parsing the padding attribute of the parent element. Other standard browsers such as Firefox, Chrome, etc. are positioned with reference to the edge of the parent element. .
In the introduction of CSS attributes, position:absolute; is positioned with reference to the edge area of the box with positioning attributes at the previous level. In other words, the parsing of IE6 here is an error, or a BUG. .
The code is as follows:
(All elements such as !DOCTYPE declaration are omitted here)
Why doesn’t anyone leave me a comment?
The deviation problem of the IE6 positioning box model is not limited to this one place
You only mentioned one of them
What else is there? ? Please give me some advice!
I know there is another difference is that when a
contains a when inside When the layer width is greater than the width of the outer layer, the outer layer will be expanded in IE. Other browsers will cut off the overflowing part. You can add a background to the inner and outer layers to see the effectThere is also the largest one The difference is that in ie6, in non-standard mode, width=margin border padding widthIn