position-relative-016.xht (1723B)
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: Relative positioning and computed top/bottom values</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 <link rel="match" href="position-relative-016-ref.xht" /> 9 10 <meta name="assert" content="Used value of top equals negative bottom when top is auto and bottom is given. (Computed value of top remains auto.)" /> 11 <style type="text/css"> 12 div 13 { 14 height: 1in; 15 width: 1in; 16 } 17 #div0 18 { 19 border: 1px solid transparent; 20 height: 0; 21 } 22 #div1 23 { 24 position: absolute; 25 background: red; 26 margin-top: 1in; 27 } 28 #div2 29 { 30 bottom: -1in; 31 position: relative; 32 top: auto; 33 } 34 #div3 35 { 36 background: green; 37 position: relative; 38 top: inherit; 39 } 40 </style> 41 </head> 42 <body> 43 <p>Test passes if there is <strong>no red</strong>.</p> 44 <div id="div0"></div> 45 <div id="div1"></div> 46 <div id="div2"> 47 <div id="div3"></div> 48 </div> 49 </body> 50 </html>