position-absolute-003

Absolute position element taken out of flow

WeasyPrint

This browser

Assertion
Absolute positioned elements are taken out of the normal flow when they have explicit offsets.

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: Absolute position element taken out of flow</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#absolute-positioning">
 7         <meta name="flags" content="">
 8         <meta name="assert" content="Absolute positioned elements are taken out of the normal flow when they have explicit offsets.">
 9         <style type="text/css">
10             #div1
11             {
12                 height: 1in;
13                 position: relative;
14                 width: 2in;
15             }
16             #div2, #div3
17             {
18                 height: 1in;
19                 width: 1in;
20             }
21             #div2
22             {
23                 background: red;
24             }
25             #div3
26             {
27                 background: green;
28                 position: absolute;
29                 left: 0;
30                 top: 0;
31             }
32         </style>
33     </head>
34     <body>
35         <p>Test passes if there is no red visible on the page.</p>
36         <div id="div1">
37             <div id="div2"></div>
38             <div id="div3"></div>
39         </div>
40     </body>
41 </html>