margin-collapse-118

Margin Collapsing: in flow (height)

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 (height)</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/018.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; width: 1em; }
11    /* test */
12    .test .outer { background: orange; }
13    .test .a { background: red; margin: 0; height: auto; }
14    .test .aa { background: yellow; margin: 0 0 1em 0; height: 1em; }
15    .test .b { background: lime; margin: 0; height: 1em; }
16    /* control */
17    .control .a { border-top: 1em yellow solid; }
18    .control .b { border-top: 1em orange solid; }
19    .control .c { border-top: 1em lime solid; }
20   </style>
21  </head>
22  <body>
23   <p>The following box should contain exactly three bands, one yellow, one orange, and one lime, with <strong>absolutely no red visible</strong>.</p>
24   <table>
25    <tr>
26     <td class="test">
27      <div class="outer">
28       <div class="a">
29        <div class="aa"></div>
30       </div>
31       <div class="b"></div>
32      </div>
33     </td>
34     <td class="control">
35      <div class="a"></div>
36      <div class="b"></div>
37      <div class="c"></div>
38     </td>
39    </tr>
40   </table>
41  
42 
43 </body>
44 </html>