floats-027

Margin affects right floated elements

WeasyPrint

This browser

Assertion
Right outer edge of left-floating box cannot be to the right of the left outer edge of any right-floating box that is to the right of it.

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: Margin affects right 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="Right outer edge of left-floating box cannot be to the right of the left outer edge of any right-floating box that is to the right of it.">
 9         <style type="text/css">
10             div
11             {
12                 border: solid 5px black;
13                 height: 2in;
14                 width: 2in;
15             }
16             span
17             {
18                 height: 1in;
19                 width: 1in;
20             }
21             #span1
22             {
23                 background: blue;
24                 float: right;
25                 margin-left: 10px;
26             }
27             #span2
28             {
29                 background-color: orange;
30                 float: left;
31                 margin-right: 10px;
32             }
33         </style>
34     </head>
35     <body>
36         <p>Test passes if the blue box is aligned on the right side of the black box and is above the orange, left aligned, box.</p>
37         <div>
38             <span id="span1"></span>
39             <span id="span2"></span>
40         </div>
41     </body>
42 </html>