margin-collapse-111

Margin Collapsing: in flow (simple combinations with collapse-through)

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 combinations with collapse-through)</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/011.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: orange; }
10    td { padding: 0; }
11    .a, .b { height: 1em; width: 1em; }
12    .a { background: lime; }
13    .b { background: yellow; }
14    .c { background: red; margin: 1em 0 1em; }
15    .t1 .a { margin: 1em 0 1em; }
16    .t1 .b { margin: 1em 0 1em; }
17    .t2 .a { margin: 1em 0 1em; }
18    .t2 .b { margin: 0em 0 1em; }
19    .t3 .a { margin: 1em 0 0em; }
20    .t3 .b { margin: 1em 0 1em; }
21    .t4 .a { margin: 1em 0 2em; }
22    .t4 .b { margin: -1em 0 1em; }
23    .t5 .a { margin: 1em 0 -1em; }
24    .t5 .b { margin: 2em 0 1em; }
25   </style>
26  </head>
27  <body>
28   <p>The square should consist of exactly five equal bands, orange, lime, orange, yellow, orange.</p>
29   <table>
30    <tr>
31     <td class="t1">
32      <div class="a"></div>
33      <div class="c"></div>
34      <div class="b"></div>
35     </td>
36     <td class="t2">
37      <div class="a"></div>
38      <div class="c"></div>
39      <div class="b"></div>
40     </td>
41     <td class="t3">
42      <div class="a"></div>
43      <div class="c"></div>
44      <div class="b"></div>
45     </td>
46     <td class="t4">
47      <div class="a"></div>
48      <div class="c"></div>
49      <div class="b"></div>
50     </td>
51     <td class="t5">
52      <div class="a"></div>
53      <div class="c"></div>
54      <div class="b"></div>
55     </td>
56    </tr>
57   </table>
58   <p>This test is meaningless if you don't pass <a href="margin-collapse-106">margin-collapse-106</a>.</p>
59  
60 
61 </body>
62 </html>