absolute-non-replaced-max-height-002.xht (1873B)
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</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-29 --> 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-002-ref.xht" /> 9 10 <meta name="flags" content="ahem" /> 11 <meta name="assert" content="When 'top', 'height', and 'bottom' of an absolutely positioned element are 'auto', then set 'top' to the static position and make 'height' based on the content; such height may be constrained by a given 'max-height' value." /> 12 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 13 <style type="text/css"> 14 #div1 15 { 16 border: solid black; 17 height: 200px; 18 position: relative; 19 width: 200px; 20 } 21 div div 22 { 23 background: blue; 24 bottom: auto; 25 font: 100px/1 Ahem; 26 height: auto; 27 margin-bottom: auto; 28 margin-top: auto; 29 max-height: 50px; 30 position: absolute; 31 right: 0; 32 top: auto; 33 } 34 </style> 35 </head> 36 <body> 37 <p>Test passes if there is a blue rectangle in the <strong>upper-right corner</strong> of an hollow black square.</p> 38 <div id="div1"> 39 <div> </div> 40 </div> 41 </body> 42 </html>