margin-collapse-114

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/014.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; vertical-align: top;}
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: 2em 0 1em 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: 3em orange solid; }
23    .control .c { border-top: 1em aqua solid; }
24    .control .d { border-top: 1em lime solid; }
25    .control .e { border-top: 1em orange solid; }
26   </style>
27  </head>
28  <body>
29   <p>The pattern below should be a stack of horizontal bars 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 pos"></div>
36      </div>
37      <div class="c"></div>
38     </td>
39     <td class="test">
40      <div class="a"></div>
41      <div class="b">
42       <div class="d float"></div>
43      </div>
44      <div class="c"></div>
45     </td>
46     <td class="control">
47      <div class="a"></div>
48      <div class="b"></div>   
49      <div class="c"></div>
50      <div class="d"></div>
51      <div class="e"></div>
52     </td>
53    </tr>
54   </table>
55   <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>
56  
57 
58 </body>
59 </html>