1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <title>CSS Test: Margin collapsing - clearance applied to sibling</title>
5 <link rel="author" title="Microsoft" href="http://www.microsoft.com/">
6 <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins">
7 <meta name="flags" content="ahem image">
8 <meta name="assert" content="If an in-flow block-level sibling (#div4) has clearance applied to it, then it will not adjoin its top margin with the bottom margin of its previous in-flow sibling (#div2).">
9 <style type="text/css">
10 div
11 {
12 font: 20px/1em Ahem;
13 width: 5em;
14 }
15 #div3
16 {
17 float: left;
18 height: 3em;
19 }
20 #div1
21 {
22 background: url('support/margin-collapse-4em-space.png');
23 height: 6em;
24 }
25 #div2
26 {
27 margin-bottom: 1em;
28 }
29 #div4
30 {
31 clear: both;
32 margin-top: 2em;
33 }
34 #div2, #div4
35 {
36 background: green;
37 height: 1em;
38 }
39 </style>
40 </head>
41 <body>
42 <p>Test passes if there is no red visible on the page.</p>
43 <div id="div1">
44 <div id="div2"></div>
45 <div id="div3"></div>
46 <div id="div4"></div>
47 </div>
48 </body>
49 </html>