1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html lang="en">
3 <!-- This is similar to tests 022 and 023 --><head>
4 <title>CSS Test: Margin Collapsing: clear (varying margins)</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/057.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 .test { border: solid; background: red; width: 8em; }
10 .container { background: lime; }
11 .float { float: left; height: 4em; width: 4em; background: aqua; }
12 .empty { margin: 1em; background: red; }
13 .clear { clear: left; border-bottom: 4em solid yellow; background: red; }
14 .a .clear { margin-top: 0em; }
15 .b .clear { margin-top: 1em; }
16 .c .clear { margin-top: 2em; }
17 </style>
18 </head>
19 <body>
20 <p>There six boxes below should look the same with no red present.</p>
21 <table>
22 <tr>
23 <td>
24 <div class="test a">
25 <div class="container">
26 <div class="float"> </div>
27 <div class="clear"> </div>
28 </div>
29 </div>
30 </td>
31 <td>
32 <div class="test b">
33 <div class="container">
34 <div class="float"> </div>
35 <div class="clear"> </div>
36 </div>
37 </div>
38 </td>
39 <td>
40 <div class="test c">
41 <div class="container">
42 <div class="float"> </div>
43 <div class="clear"> </div>
44 </div>
45 </div>
46 </td>
47 </tr>
48 <tr>
49 <td>
50 <div class="test a">
51 <div class="container">
52 <div class="float"> </div>
53 <div class="clear"> <div class="empty"> </div> </div>
54 </div>
55 </div>
56 </td>
57 <td>
58 <div class="test b">
59 <div class="container">
60 <div class="float"> </div>
61 <div class="clear"> <div class="empty"> </div> </div>
62 </div>
63 </div>
64 </td>
65 <td>
66 <div class="test c">
67 <div class="container">
68 <div class="float"> </div>
69 <div class="clear"> <div class="empty"> </div> </div>
70 </div>
71 </div>
72 </td>
73 </tr>
74 </table>
75
76
77 </body>
78 </html>