margin-collapse-105.xht (1733B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> 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="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-08-15 --> 7 <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/block/margin-collapse/005.html" type="text/html"/> 8 <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"/> 9 <link rel="match" href="margin-collapse-101-ref.xht" /> 10 11 <style type="text/css"> 12 table { border-spacing: 0; font-size: 50px; border: solid 3px; } 13 td { background: orange; padding: 0; } 14 div { margin: 1em 0; } 15 .test div { position: relative; } 16 .a { background: yellow; } 17 .b { background: lime; } 18 .c { background: aqua; } 19 .d { background: blue; } 20 .red { background: red; } 21 </style> 22 </head> 23 <body> 24 <p>Test passes if there is a stack of multi-colored horizontal bars with no red.</p> 25 <table> 26 <tr> 27 <td class="test"> 28 <div class="d"> 29 <div class="red"><div class="red"><div class="a">A</div></div><div class="red"></div></div> 30 <div class="red"></div> 31 <div class="red"><div class="red"></div></div> 32 <div class="red"><div class="b"><div class="red"></div>B</div></div> 33 <div class="c">C</div> 34 </div> 35 </td> 36 <td class="control"> 37 <div class="d"> 38 <div class="a">A</div> 39 <div class="b">B</div> 40 <div class="c">C</div> 41 </div> 42 </td> 43 </tr> 44 </table> 45 46 </body> 47 </html>