position-fixed-003

Position fixed on different media types

WeasyPrint

This browser

Flags
interact
Assertion
Elements that are set to 'position: fixed' are fixed with respect to the viewport.

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: Position fixed on different media types</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#propdef-position">
 7         <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#choose-position">
 8         <meta name="flags" content="interact">
 9         <meta name="assert" content="Elements that are set to 'position: fixed' are fixed with respect to the viewport.">
10         <style type="text/css">
11             #filler
12             {
13                 height: 6000px;
14                 margin: 10px;
15             }
16             @media handheld, projection, screen, tty, tv
17             {
18                 #div1
19                 {
20                     background: blue;
21                     height: 25px;
22                     position: fixed;
23                     top: 50px;
24                 }
25             }
26         </style>
27     </head>
28     <body>
29         <p>Test passes if the box below does not move when the page is scrolled.</p>
30         <div id="div1">Filler Text</div>
31         <div id="filler"></div>
32     </body>
33 </html>