margin-collapse-115

Margin Collapsing: in flow (position of collapsed-through element)

WeasyPrint

This browser

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html lang="en">
 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="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/block/margin-collapse/015.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; background: red; }
10    td { padding: 0; }
11    /* test */
12    .test { background: orange; width: 1em; }
13    .test .a { background: yellow; margin: 0 0 1em 0; height: 1em; }
14    .test .b { background: red; margin: 2em 0 0 0; }
15    .test .c { background: aqua; margin: 3em 0 0 0; height: 1em; }
16    .test .d { background: lime; margin: 0; position: absolute; height: 1em; width: 1em; }
17    /* control */
18    .control div { width: 1em; }
19    .control .a { border-top: 1em yellow solid; }
20    .control .b { border-top: 2em orange solid; }
21    .control .c { border-top: 1em lime solid; }
22    .control .d { border-top: 1em aqua solid; }
23   </style>
24  </head>
25  <body>
26   <p>The pattern below should be a stack of horizontal bars with no red.</p>
27   <table>
28    <tr>
29     <td class="test">
30      <div class="a"></div>
31      <div class="b">
32       <div class="d"></div>
33      </div>
34      <div class="c"></div>
35     </td>
36     <td class="control">
37      <div class="a"></div>
38      <div class="b"></div>   
39      <div class="c"></div>
40      <div class="d"></div>
41     </td>
42    </tr>
43   </table>
44   <p>This test is meaningless if you don't pass <a href="margin-collapse-106">test 006</a> and <a href="margin-collapse-155">test 055</a>.</p>
45  
46 
47 </body>
48 </html>