Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / css2.1 / 20110323 / margin-collapse-clear-012.htm
blob4689a5ef3323c142d4ba653cdeb2f12b89a6df9f
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 collapse with the adjoining margins of following siblings but the resulting margin does 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: 80px;
39 margin-top: 40px;
42 #following-sibling {margin-bottom: 140px;}
44 #next-yellow
46 background-color: yellow;
47 height: 100px;
50 .ref-overlapped-red
52 background-color: red;
53 position: absolute;
54 z-index: -1;
57 #ref1
59 height: 200px;
60 top: 1px;
61 width: 50%;
64 #ref2
66 height: 100px;
67 top: 201px;
68 width: 100%;
70 </style>
72 </head>
74 <body>
76 <p>Test passes if there is <strong>no red</strong>.</p>
78 <div id="rel-pos-wrapper">
80 <!--
82 #parent-lime should have height 200px, sum of:
84 100px : height of #float-left-blue
86 (140px - 40px) : part of #following-sibling's margin-bottom
87 "exceeding" the amount collapsed with
88 #clear-left's margin-top (140px - 40px)
89 =======
90 200px
92 -->
94 <div id="parent-lime">
95 <div id="float-left-blue"></div>
96 <div id="clear-left"></div>
98 <!--
100 clearance
102 margin-top of #clear-left (40px)
103 ====================================
104 height of #float-left-blue (100px)
106 therefore, clearance is equal to +60px
110 <div id="following-sibling"></div>
111 </div>
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>