floats-001

Floats, shifting left until it touches container edge

WeasyPrint

This browser

Assertion
A left floated box shifts left until its outer edge touches the containing block edge.

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, shifting left until it touches container edge</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="A left floated box shifts left until its outer edge touches the containing block edge.">
 9         <style type="text/css">
10             #div1
11             {
12                 border: solid 5px black;
13                 height: 1in;
14                 width: 2in;
15             }
16             div div
17             {
18                 display: inline-block;
19                 height: 1in;
20                 width: 1in;
21             }
22             #div3
23             {
24                 background-color: blue;
25                 float: left;
26             }
27         </style>
28     </head>
29     <body>
30         <p>Test passes if the blue box is on the left inner edge of the black box.</p>
31         <div id="div1">
32            <div id="div2"></div>
33            <div id="div3"></div>
34         </div>
35     </body>
36 </html>