floats-028

Floats and containment

WeasyPrint

This browser

Assertion
Floating box's outer top cannot be higher than the top of its containing block.

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: Floats and containment</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#floats">
 7         <meta name="flags" content="">
 8         <meta name="assert" content="Floating box's outer top cannot be higher than the top of its containing block.">
 9         <style type="text/css">
10             div
11             {
12                 border: solid 5px black;
13                 height: 2in;
14                 margin: 0.25in;
15                 position: absolute;
16                 top: 10px;
17                 width: 2in;
18             }
19             span
20             {
21                 background-color: blue;
22                 float: left;
23                 height: 1.25in;
24                 width: 1.25in;
25             }
26         </style>
27     </head>
28     <body>
29         <p>Test passes if the blue box is completely contained within the black box.</p>
30         <div>
31             <span>Filler Text</span>
32         </div>
33     </body>
34 </html>