margin-collapse-115.xht (2009B)
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 <!-- This test is basically the same as 013.html --><head> 4 <title>CSS Test: Margin Collapsing: in flow (position of collapsed-through element)</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-17 --> 7 <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/block/margin-collapse/015.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-115-ref.xht" /> 10 11 <style type="text/css"> 12 table { border-spacing: 0; font-size: 50px; border: solid 3px; background: red; } 13 td { padding: 0; } 14 /* test */ 15 .test { background: orange; width: 1em; } 16 .test .a { background: yellow; margin: 0 0 1em 0; height: 1em; } 17 .test .b { background: red; margin: 2em 0 0 0; } 18 .test .c { background: aqua; margin: 3em 0 0 0; height: 1em; } 19 .test .d { background: lime; margin: 0; position: absolute; height: 1em; width: 1em; } 20 /* control */ 21 .control div { width: 1em; } 22 .control .a { border-top: 1em yellow solid; } 23 .control .b { border-top: 2em orange solid; } 24 .control .c { border-top: 1em lime solid; } 25 .control .d { border-top: 1em aqua solid; } 26 </style> 27 </head> 28 <body> 29 <p>Test passes if there is a stack of 4 bands which are <strong>from top to bottom: yellow, orange, lime, aqua</strong> and with no red.</p> 30 <table> 31 <tr> 32 <td class="test"> 33 <div class="a"></div> 34 <div class="b"> 35 <div class="d"></div> 36 </div> 37 <div class="c"></div> 38 </td> 39 <td class="control"> 40 <div class="a"></div> 41 <div class="b"></div> 42 <div class="c"></div> 43 <div class="d"></div> 44 </td> 45 </tr> 46 </table> 47 48 </body> 49 </html>