containing-block-007

Initial containing block for fixed positioned elements

WeasyPrint

This browser

Assertion
The containing block is established by the viewport when an element uses fixed positioning.

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: Initial containing block for fixed 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/visudet.html#containing-block-details">
 7         <meta name="flags" content="">
 8         <meta name="assert" content="The containing block is established by the viewport when an element uses fixed positioning.">
 9         <style type="text/css">
10             #div1
11             {
12                 position: relative;
13                 bottom: 0;
14             }
15             div div
16             {
17                 background: blue;
18                 height: 1in;
19                 position: fixed;
20                 right: 0;
21                 top: 0;
22                 width: 1in;
23             }
24         </style>
25     </head>
26     <body>
27         <p>Test passes if there is a blue box in the upper-right corner of the page.</p>
28         <div id="div1">
29             <div></div>
30         </div>
31     </body>
32 </html>