Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / css2.1 / 20110323 / margin-collapse-clear-013.htm
blob14befd6b7cadc8c56ee5ba37e8feeaf09fd9e660
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
4 <head>
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;}
20 #parent-lime
22 background-color: lime;
23 border-top: black solid 1px;
24 width: 50%;
27 #float-left-blue
29 background-color: blue;
30 float: left;
31 height: 100px;
32 width: 100px;
35 #clear-left
37 clear: left;
38 margin-bottom: 140px;
39 margin-top: 40px;
42 #next-yellow
44 background-color: yellow;
45 height: 100px;
48 .ref-overlapped-red
50 background-color: red;
51 position: absolute;
52 z-index: -1;
55 #ref1
57 height: 200px;
58 top: 1px;
59 width: 50%;
62 #ref2
64 height: 100px;
65 top: 201px;
66 width: 100%;
68 </style>
70 </head>
72 <body>
74 <p>Test passes if there is <strong>no red</strong>.</p>
76 <div id="rel-pos-wrapper">
78 <!--
80 clearance
82 margin-top of #clear-left (40px)
83 ====================================
84 height of #float-left-blue (100px)
86 therefore, clearance is equal to +60px
88 -->
90 <!--
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)
99 =======
100 200px
104 <div id="parent-lime">
105 <div id="float-left-blue"></div>
106 <div id="clear-left"></div>
107 </div>
109 <!--
110 #next-yellow should immediately follow #parent-lime (no margins in between)
113 <div id="next-yellow"></div>
115 <!--
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>
124 </div>
126 </body>
127 </html>