margin-collapse-113

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 <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/013.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; position: relative; }
15    .test .c { background: aqua; margin: 3em 0 0 0; height: 1em; }
16    .test .d { background: lime; margin: 0; height: 1em; width: 100%; }
17    .test .pos { position: absolute; }
18    .test .float { float: left; }
19    /* control */
20    .control div { width: 1em; }
21    .control .a { border-top: 1em yellow solid; }
22    .control .b { border-top: 2em orange solid; }
23    .control .c { border-top: 1em lime solid; }
24    .control .d { border-top: 1em aqua solid; }
25   </style>
26  </head>
27  <body>
28   <p>The pattern below should be a stack of horizontal bars with no red.</p>
29   <table>
30    <tr>
31     <td class="test">
32      <div class="a"></div>
33      <div class="b">
34       <div class="d pos"></div>
35      </div>
36      <div class="c"></div>
37     </td>
38     <td class="test">
39      <div class="a"></div>
40      <div class="b">
41       <div class="d float"></div>
42      </div>
43      <div class="c"></div>
44     </td>
45     <td class="control">
46      <div class="a"></div>
47      <div class="b"></div>   
48      <div class="c"></div>
49      <div class="d"></div>
50     </td>
51    </tr>
52   </table>
53   <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>
54  
55 
56 </body>
57 </html>