position-relative-002

Elements following relatively positioned elements

WeasyPrint

This browser

Assertion
Element following relatively positioned element show up in normal flow as if the relatively positioned element were not offset.

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: Elements following relatively 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#propdef-position">
 7         <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#choose-position">
 8         <meta name="flags" content="">
 9         <meta name="assert" content="Element following relatively positioned element show up in normal flow as if the relatively positioned element were not offset.">
10         <style type="text/css">
11             #div1
12             {
13                 background: blue;
14                 height: 2px;
15                 left: 0;
16                 position: relative;
17                 top: 24px;
18                 width: 200px;
19             }
20             #span1
21             {
22                 position: relative;
23                 top: 25px;
24             }
25         </style>
26     </head>
27     <body>
28         <p>Test passes if the letter "a" is below the blue line and the letter "b" is above.</p>
29         <div>
30             <div id="div1"></div>
31             <span id="span1">a</span>
32             <span>b</span>
33         </div>
34     </body>
35 </html>