clear-float-002

Clearance of floats and top margin affect

WeasyPrint

This browser

Assertion
Clearance is introduced as spacing above the top margin.

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html>
 3     <head>
 4         <title>CSS Test: Clearance of floats and top margin affect</title>
 5         <link rel="author" title="Microsoft" href="http://www.microsoft.com/">
 6         <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control">
 7         <meta name="flags" content="">
 8         <meta name="assert" content="Clearance is introduced as spacing above the top margin.">
 9         <style type="text/css">
10             div div
11             {
12                 float: right;
13                 height: 1in;
14                 width: 1in;
15             }
16             #div1
17             {
18                 height: 2in;
19                 width: 2in;
20             }
21             #div2
22             {
23                 background: red;
24             }
25             #div3
26             {
27                 background: green;
28                 clear: right;
29                 margin-top: -1in;
30             }
31         </style>
32     </head>
33     <body>
34         <p>Test passes if there is no red visible on the page.</p>
35         <div id="div1">
36             <div id="div2"></div>
37             <div id="div3"></div>
38         </div>
39     </body>
40 </html>