floats-031

Position of floated elements in relation to previous inline elements

WeasyPrint

This browser

Flags
image
Assertion
Outer top of floating box cannot be higher than the top of any line-box containing a 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 inline 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 floating box cannot be higher than the top of any line-box containing a box generated by an element earlier in the source document.">
 9         <style type="text/css">
10             div
11             {
12                 border: solid 5px black;
13                 font: 16px serif;
14                 margin: 10px;
15                 width: 550px;
16             }
17             #span1
18             {
19                 background-color: orange;
20                 float: left;
21             }
22             #span1, img
23             {
24                 height: 0.5in;
25                 width: 1in;
26             }
27             span span
28             {
29                 display: inline-block;
30                 width: 550px;
31             }
32         </style>
33     </head>
34     <body>
35         <p>Test passes if the orange box is to the left of the "Filler Text" and the blue box is to the right of the "Filler Text".</p>
36         <div>
37             <span><span></span>Filler Text Filler Text</span>
38             <img alt="blue box" src="support/blue15x15.png">
39             <span id="span1"></span>
40         </div>
41     </body>
42 </html>