margin-collapse-123

Margin Collapsing: clear (with nearby collapse-through block)

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: clear (with nearby collapse-through block)</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/023.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, td { padding: 0; border-spacing: 0; }
10    .comparator { border-spacing: 1em; }
11    .test, .control { background: red; }
12    .test .container { display: block; margin: 0; width: 6em; background: yellow; border: solid; }
13    .test .float { float: left; margin: 0; height: 2em; width: 3em; background: orange; }
14    .test .empty { display: block; background: red; margin: 2em 0; }
15    .test .clear { clear: left; display: block; border-top: 2em solid orange; margin-top: 1em; }
16    .control table { border: solid; }
17    .control .square { height: 2em; width: 3em; }
18    .control .thin { height: 2em; width: 6em; }
19    .control .thick { height: 2em; width: 6em; }
20    .control .yellow { background: yellow; }
21    .control .orange { background: orange; }
22   </style>
23  </head>
24  <body>
25   <p>The following two boxes should be identical.</p>
26   <table class="comparator">
27    <tr>
28     <td class="test">
29      <div class="container">
30       <div class="float"> </div>
31       <div class="empty"> </div>
32       <div class="clear"> </div>
33      </div>
34     </td>
35     <td class="control">
36      <table>
37       <tr>
38        <td class="square orange"></td>
39        <td class="square yellow"></td>
40       </tr>
41       <tr>
42        <td colspan="2" class="thin orange"></td>
43       </tr>
44      </table>
45     </td>
46    </tr>
47   </table>
48  
49 
50 </body>
51 </html>