absolute-replaced-height-019.xht (1723B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <title>CSS Test: Absolutely positioned inline-block replaced element with its height set to a percentage and 'top', 'bottom' are not 'auto'</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-01 --> 7 <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height" /> 8 <link rel="match" href="absolute-replaced-height-012-ref.xht" /> 9 10 <meta name="assert" content="An absolutely positioned inline-block replaced element with its height set to a percentage is resolvable if and when its containing block height is explicitly specified and computable." /> 11 <style type="text/css"> 12 #div1 13 { 14 position: relative; 15 height: 2in; 16 } 17 div div 18 { 19 border: solid green; 20 height: 1in; 21 position: absolute; 22 top: 1in; 23 width: 300px; 24 } 25 iframe 26 { 27 border: solid red; 28 bottom: 1in; 29 position: absolute; 30 top: 1in; 31 width: auto; 32 } 33 </style> 34 </head> 35 <body> 36 <p>Test passes if there is <strong>no red</strong>.</p> 37 <div id="div1"> 38 <iframe height="50%"></iframe> 39 <div></div> 40 </div> 41 </body> 42 </html>