margin-collapse-112

Margin Collapsing: in flow (simple)

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 (simple)</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/012.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: 50px/1 Ahem; border: solid; background: red; }
10    td { padding: 0; }
11    /* test */
12    .test { background: orange; }
13    .test div { margin: 1em 0; background: red; height: 1em; width: 1em; }
14    .test .a { background: yellow; }
15    .test .b { background: lime; }
16    /* control */
17    .control div { width: 1em; }
18    .control .c { border-top: 1em orange solid; }
19    .control .a { border-top: 1em yellow solid; }
20    .control .b { border-top: 1em lime solid; }
21   </style>
22  </head>
23  <body>
24   <p>The pattern below should be a stack of horizontal bars with no red.</p>
25   <table>
26    <tr>
27     <td class="test">
28      <div class="a"></div>
29      <div class="b"></div>
30     </td>
31     <td class="control">
32      <div class="c"></div>
33      <div class="a"></div>
34      <div class="c"></div>
35      <div class="b"></div>   
36      <div class="c"></div>
37     </td>
38    </tr>
39   </table>
40   <p>This test is meaningless if you don't pass <a href="margin-collapse-106">test 006</a>.</p>
41  
42 
43 </body>
44 </html>