absolute-replaced-height-014.xht (1920B)
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 elements with percentage based intrinsic height that cannot be resolved and 'top' specified</title> 5 <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> 6 <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-replaced-height" /> 7 <link rel="match" href="absolute-replaced-height-014-ref.xht" /> 8 9 <meta name="assert" content="An absolutely positioned inline-block replaced element with a percentage height that cannot be resolved has no intrinsic height." /> 10 <!-- 11 " 12 (...) the height of the containing block of an absolutely 13 positioned element is independent of the size of the element itself, 14 and thus a percentage height on such an element *_can always be 15 resolved_*. However, it may be that the height is not known until 16 elements that come later in the document have been processed. 17 " 18 http://www.w3.org/TR/CSS21/visudet.html#the-height-property 19 --> 20 21 <style type="text/css"> 22 div#containing-block 23 { 24 position: relative; 25 } 26 div div 27 { 28 border: solid green; 29 position: absolute; 30 top: 1in; 31 width: 300px; 32 } 33 iframe 34 { 35 border: solid red; 36 bottom: auto; 37 position: absolute; 38 top: 1in; 39 width: auto; 40 } 41 </style> 42 </head> 43 <body> 44 <p>Test passes if there is <strong>no red</strong>.</p> 45 <div id="containing-block"> 46 <iframe height="50%"></iframe> 47 <div></div> 48 </div> 49 </body> 50 </html>