floats-030

Position of floated elements in relation to previous elements

WeasyPrint

This browser

Flags
image
Assertion
Outer top of a floating box cannot be higher than the outer top of any block or floated box generated by an element earlier in the source document.

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: Position of floated elements in relation to previous 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="image">
 8         <meta name="assert" content="Outer top of a floating box cannot be higher than the outer top of any block or floated box generated by an element earlier in the source document.">
 9         <style type="text/css">
10             #d1
11             {
12                 border: solid 5px black;
13                 margin: 10px;
14                 height: 150px;
15             }
16             #span1, img
17             {
18                 height: 1in;
19                 width: 1in;
20             }
21             #span1
22             {
23                 background-color: orange;
24                 float: left;
25                 margin-top: 10px;
26                 padding-top: 10px;
27             }
28         </style>
29     </head>
30     <body>
31         <p>Test passes if the orange box is within the black box, below the words "Filler Text 1", and to the left of both the blue box and the words "Filler Text 2".</p>
32         <div id="d1">
33             <div>Filler Text 1</div>
34             <span>Filler Text 2</span>
35             <img alt="blue box" src="support/blue15x15.png">
36             <span id="span1"></span>
37         </div>
38     </body>
39 </html>