margin-collapse-116

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 is similar to tests 013 to 015 --><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/016.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: 1em 0 0 0; }
15    .test .c { background: aqua; margin: 2em 0 1em 0; height: 1em; }
16    .test .d { background: lime; position: absolute; height: 1em; width: 1em; margin: 2em 0 0 0; }
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 aqua solid; }
22    .control .d { border-top: 1em lime 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>
30      <div class="test">
31       <div class="a"></div>
32       <div class="b">
33        <div class="d"></div>
34       </div>
35       <div class="c"></div>
36      </div>
37     </td>
38     <td class="control">
39      <div class="a"></div>
40      <div class="b"></div>   
41      <div class="c"></div>
42      <div class="d"></div>
43     </td>
44    </tr>
45   </table>
46   <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>
47  
48 
49 </body>
50 </html>