1 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
6 <title>CSS Test: Margin collapsing with clearance - margins of a 'collapsed through' box with clearance do not collapse with parent block's bottom margin
</title>
8 <link rel=
"help" href=
"http://www.w3.org/TR/CSS21/box.html#collapsing-margins">
9 <link rel=
"help" href=
"http://www.w3.org/TR/CSS21/visudet.html#normal-block">
10 <link rel=
"author" title=
"GĂ©rard Talbot" href=
"http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
11 <link rel=
"author" title=
"Bruno Fassino" href=
"fassino[at]gmail.com">
12 <link rel=
"match" href=
"margin-collapse-clear-012-ref.htm">
14 <meta content=
"When an element has had clearance applied to it and its own margins collapse, these margins do not collapse with the bottom margin of the parent block" name=
"assert">
15 <meta content=
"" name=
"flags">
17 <style type=
"text/css">
18 #rel-pos-wrapper {position: relative
;}
22 background-color: lime
;
23 border-top: black solid
1px;
29 background-color: blue
;
44 background-color: yellow
;
50 background-color: red
;
74 <p>Test passes if there is
<strong>no red
</strong>.
</p>
76 <div id=
"rel-pos-wrapper">
82 margin-top of #clear-left (40px)
83 ====================================
84 height of #float-left-blue (100px)
86 therefore, clearance is equal to +60px
92 #parent-lime should have height 200px, sum of:
94 100px : height of #float-left-blue
96 (140px - 40px) : part of #sole-following-sibling's margin-bottom
97 "exceeding" the amount collapsed with
98 #clear-left's margin-top (140px - 40px)
104 <div id=
"parent-lime">
105 <div id=
"float-left-blue"></div>
106 <div id=
"clear-left"></div>
110 #next-yellow should immediately follow #parent-lime (no margins in between)
113 <div id=
"next-yellow"></div>
116 #ref1 and #ref2 boxes create a sort of 'reference rendering'
117 where #ref1 should be covered, overlapped by #parent-lime
118 while #ref2 should be covered, overlapped by #next-yellow.
121 <div id=
"ref1" class=
"ref-overlapped-red"></div>
122 <div id=
"ref2" class=
"ref-overlapped-red"></div>