block-formatting-contexts-009

New block formatting context with absolute positioned elements

WeasyPrint

This browser

Assertion
Absolutely positioned elements establish a new block formatting context.

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: New block formatting context with absolute positioned 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#block-formatting">
 7         <meta name="flags" content="">
 8         <meta name="assert" content="Absolutely positioned elements establish a new block formatting context.">
 9         <style type="text/css">
10             div
11             {
12                 position: absolute;
13             }
14             #div1
15             {
16                 border: solid;
17                 height: 200px;
18                 width: 200px;
19             }
20             div div
21             {
22                 background: blue;
23                 display: inline;
24                 height: 50%;
25                 width: 100%;
26             }
27         </style>
28     </head>
29     <body>
30         <p>Test passes if the upper-half of the box below is blue.</p>
31         <div id="div1">
32             <div></div>
33         </div>
34     </body>
35 </html>