absolute-non-replaced-max-height-009.xht (2005B)
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: Max-height on absolutely positioned, non-replaced elements, height is shrink-to-fit</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-08-31 --> 7 <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height" /> 8 <link rel="match" href="absolute-non-replaced-max-height-009-ref.xht" /> 9 10 <meta name="flags" content="ahem" /> 11 <meta name="assert" content="The 'height' is based on the content height, 'auto' values for 'margin-top' and 'margin-bottom' are set to '0' when 'height' and 'bottom' are 'auto' and 'top' is not 'auto'." /> 12 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 13 <style type="text/css"> 14 #div1 15 { 16 position: relative; 17 } 18 #div2 19 { 20 background: blue; 21 height: 50px; 22 left: 100px; 23 position: absolute; 24 top: 25px; 25 width: 100px; 26 } 27 #div3 28 { 29 background: orange; 30 bottom: auto; 31 font: 100px/1 Ahem; 32 height: auto; 33 margin-bottom: auto; 34 margin-top: auto; 35 max-height: 50px; 36 position: absolute; 37 top: 25px; 38 width: 100px; 39 } 40 </style> 41 </head> 42 <body> 43 <p>Test passes if the orange and blue rectangles have the <strong>same height</strong>.</p> 44 <div id="div1"> 45 <div id="div2"></div> 46 <div id="div3"> </div> 47 </div> 48 </body> 49 </html>