1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html lang="en">
3 <head>
4 <title>CSS Test: Margin collapsing with floats before self collapsing children with margins collapsing with parent</title>
5 <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch">
6 <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/block/margin-collapse/062.html" type="text/html">
7 <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins">
8 <style type="text/css">
9 /* This test requires half-decent z-index support */
10 /* Rendering should not not match 061.html! */
11 html { margin: 0; padding: 0; }
12 body { margin: 0 10px; padding: 0; }
13 .a { position: absolute; top: 46px; left: 10px; width: 20em; height: 4em; background: red; color: yellow; z-index: -1; }
14 .b { float: left; width: 20em; height: 4em; background: green; color: white; }
15 .c1 { margin: 2px; }
16 .c2 { margin: -4px 20px; }
17 .c3 { margin: 0 0 14px; }
18 .c4 { margin: 50px; }
19 </style>
20 </head>
21 <body>
22 <div class="c1">
23 <div class="c2">
24 <div class="c3"></div>
25 </div>
26 </div>
27 <div class="a">FAIL</div>
28 <div class="b">This block should be green.</div>
29 <div class="c4"></div>
30
31
32 </body>
33 </html>