floats-041

Floats and stacking contexts with content

WeasyPrint

This browser

Assertion
The contents of floats are stacked as if floats generated new stacking contexts.

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 and stacking contexts with content</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="The contents of floats are stacked as if floats generated new stacking contexts.">
 9         <style type="text/css">
10             div div
11             {
12                 height: 0.5in;
13                 width: 0.5in;
14             }
15             #div1
16             {
17                 background: red;
18                 float: left;
19             }
20             #div2
21             {
22                 background: green;
23                 display: block;
24                 position: relative;
25                 z-index: 10;
26             }
27             #div3
28             {
29                 background: red;
30                 position: relative;
31             }
32         </style>
33     </head>
34     <body>
35         <p>Test passes if there is no red visible on the page.</p>
36         <div>
37             <div id="div1">
38                 <div id="div2"></div>
39             </div>
40             <div id="div3"></div>
41         </div>
42     </body>
43 </html>