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: in flow (relatively positioned)</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/005.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 table { border-spacing: 0; font-size: 50px; border: solid; }
10 td { background: orange; padding: 0; }
11 div { margin: 1em 0; }
12 .test div { position: relative; }
13 .a { background: yellow; }
14 .b { background: lime; }
15 .c { background: aqua; }
16 .d { background: blue; }
17 .red { background: red; }
18 </style>
19 </head>
20 <body>
21 <p>The pattern below should be a stack of horizontal bars with no red.</p>
22 <table>
23 <tr>
24 <td class="test">
25 <div class="d">
26 <div class="red"><div class="red"><div class="a">A</div></div><div class="red"></div></div>
27 <div class="red"></div>
28 <div class="red"><div class="red"></div></div>
29 <div class="red"><div class="b"><div class="red"></div>B</div></div>
30 <div class="c">C</div>
31 </div>
32 </td>
33 <td class="control">
34 <div class="d">
35 <div class="a">A</div>
36 <div class="b">B</div>
37 <div class="c">C</div>
38 </div>
39 </td>
40 </tr>
41 </table>
42 <p>This test is meaningless if you don't pass <a href="margin-collapse-106">margin-collapse-106</a>.</p>
43
44
45 </body>
46 </html>