margin-collapse-110

Margin Collapsing: in flow (simple combinations)

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