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 (hard)</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/042.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; vertical-align: top; }
10 .comparator { border-spacing: 1em; }
11 .test, .control { border: solid; background: red; }
12 .test .container { display: block; margin: 0; width: 8em; background: lime; }
13 .test .float { float: left; margin: 0; height: 4em; width: 4em; background: aqua; }
14 .test .clear { clear: left; display: block; background: yellow; margin: 4em 0; height: 4em; }
15 .test .block { display: block; margin: 1em 0 0; border: 2em solid #AAFFAA; }
16 .control .square { height: 4em; width: 4em; }
17 .control .rectangle { height: 4em; width: 8em; }
18 .control .AAFFAA { background: #AAFFAA; }
19 .control .lime { background: lime; }
20 .control .aqua { background: aqua; }
21 .control .yellow { background: yellow; }
22 </style>
23 </head>
24 <body>
25 <p>The following two squares 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="clear"> </div>
32 <div class="block"> </div>
33 </div>
34 </td>
35 <td class="control">
36 <table>
37 <tr>
38 <td class="square aqua"></td>
39 <td class="square lime"></td>
40 </tr>
41 <tr>
42 <td colspan="2" class="rectangle yellow"></td>
43 </tr>
44 <tr>
45 <td colspan="2" class="rectangle lime"></td>
46 </tr>
47 <tr>
48 <td colspan="2" class="rectangle AAFFAA"></td>
49 </tr>
50 </table>
51 </td>
52 </tr>
53 </table>
54
55
56 </body>
57 </html>