floats-029

Content flowing around floated elements

WeasyPrint

This browser

Assertion
Floats shift the current line and surrounding content to flow along its side unless clear is specified.

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: Content flowing around floated elements</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="Floats shift the current line and surrounding content to flow along its side unless clear is specified.">
 9         <style type="text/css">
10             #span1
11             {
12                 background-color: blue;
13                 float: left;
14                 height: 1in;
15                 width: 1in;
16             }
17             body
18             {
19                 margin: 0;
20             }
21             div div
22             {
23                 clear: both;
24             }
25         </style>
26     </head>
27     <body>
28         <div>
29             <span>Filler Text</span>
30             <span id="span1"></span>
31             <div></div>
32         </div>
33         <p>Test passes if the blue box is in the top left corner of the page and the words "Filler Text" are directly to the right of the box.</p>
34     </body>
35 </html>