floats-025

Right floating elements and container edge

WeasyPrint

This browser

Assertion
Right floated boxes cannot go past the container's right 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: Right floating elements and 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="Right floated boxes cannot go past the container's right edge.">
 9         <style type="text/css">
10             div
11             {
12                 border: solid 5px black;
13                 height: 2in;
14                 width: 2in;
15             }
16             span
17             {
18                 background-color: blue;
19                 float: right;
20                 height: 1in;
21                 width: 1in;
22             }
23         </style>
24     </head>
25     <body>
26         <p>Test passes if the blue square is in the upper-right corner of the black box.</p>
27         <div>
28             <span></span>
29         </div>
30     </body>
31 </html>