Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / css2.1 / 20110323 / margin-collapse-clear-014.htm
blob5c008ea14900da006a6fa4a3553d6a6cb832c48c
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 - clearance may be negative</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-014-ref.htm">
14 <meta content="Clearance is created above the top margin of the element with clear set. Clearance can be negative. Clearance stops the collapsing of the element's margins with the preceding siblings' margins and with the parent block's bottom margin." 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 width: 50%;
26 #preceding-sibling-aqua
28 background-color: aqua;
29 height: 60px;
30 margin-bottom: 40px;
33 #float-left-blue
35 background-color: blue;
36 float: left;
37 height: 100px;
38 width: 100px;
41 #clear-left
43 clear: left;
44 margin-top: 120px;
47 #next-yellow
49 background-color: yellow;
50 height: 100px;
53 .ref-overlapped-red
55 background-color: red;
56 position: absolute;
57 z-index: -1;
60 #ref1
62 height: 200px;
63 top: 0px;
64 width: 50%;
67 #ref2
69 height: 100px;
70 top: 200px;
71 width: 100%;
73 </style>
75 </head>
77 <body>
79 <p>Test passes if there is <strong>no red</strong>.</p>
81 <div id="rel-pos-wrapper">
83 <!--
85 #parent-lime should have height 200px, sum of:
87 60px : height of #preceding-sibling-aqua
89 40px : margin-bottom of #preceding-sibling-aqua
91 100px : height of #float-left-blue
92 =====================================================
93 200px
95 -->
97 <div id="parent-lime">
98 <div id="preceding-sibling-aqua"></div>
99 <div id="float-left-blue"></div>
100 <div id="clear-left"></div>
101 </div>
103 <!--
105 clearance
107 margin-top of #clear-left (120px)
108 ====================================
109 height of #float-left-blue (100px)
111 therefore, clearance is equal to -20px
115 <div id="next-yellow"></div>
117 <!--
118 #ref1 and #ref2 boxes create a sort of 'reference rendering'
119 where #ref1 should be covered, overlapped by #parent-lime
120 while #ref2 should be covered, overlapped by #next-yellow.
123 <div id="ref1" class="ref-overlapped-red"></div>
124 <div id="ref2" class="ref-overlapped-red"></div>
126 </div>
128 </body>
129 </html>