position-relative-002.xht (1425B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 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="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-09-22 --> 7 <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#relative-positioning" /> 8 <meta name="assert" content="Element following relatively positioned element show up in normal flow as if the relatively positioned element were not offset." /> 9 <style type="text/css"> 10 body {line-height: 1.25;} 11 12 #div1 13 { 14 background: blue; 15 height: 2px; 16 left: 0; 17 position: relative; 18 top: 24px; 19 width: 200px; 20 } 21 #span1 22 { 23 position: relative; 24 top: 25px; 25 } 26 </style> 27 </head> 28 <body> 29 <p>Test passes if the letter "a" is below the blue line and the letter "b" is above the blue line.</p> 30 <div> 31 <div id="div1"></div> 32 <span id="span1">a</span> 33 <span>b</span> 34 </div> 35 </body> 36 </html>