position-absolute-005.xht (1624B)
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: Absolutely positioned elements do not establish a new containing block for fixed position descendants</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-20 --> 7 <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#absolute-positioning" /> 8 <meta name="assert" content="An absolutely positioned box does not establish a new containing block for fixed positioned descendants." /> 9 <style type="text/css"> 10 p 11 { 12 margin-top: 1in; 13 } 14 #div1 15 { 16 position: relative; 17 } 18 #div2 19 { 20 position: absolute; 21 height: 1in; 22 left: 3in; 23 top: 3in; 24 width: 1in; 25 } 26 #div3 27 { 28 background: black; 29 height: 1in; 30 left: 0; 31 position: fixed; 32 top: 0; 33 width: 1in; 34 } 35 </style> 36 </head> 37 <body> 38 <p>Test passes if there is a box in the upper-left corner of the page.</p> 39 <div id="div1"> 40 <div id="div2"> 41 <div id="div3"></div> 42 </div> 43 </div> 44 </body> 45 </html>