absolute-non-replaced-max-height-001.xht (1370B)
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, static position of fixed element</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-non-replaced-height" /> 7 <meta name="assert" content="The calculation of static position is based on initial containing block when there is a fixed positioned element." /> 8 <style type="text/css"> 9 html, body, p 10 { 11 margin: 0; 12 padding: 0; 13 } 14 #div1 15 { 16 border: solid black; 17 height: 2in; 18 position: absolute; 19 width: 2in; 20 } 21 div div 22 { 23 background: blue; 24 height: 1in; 25 max-height: 0.5in; 26 position: fixed; 27 width: 1in; 28 } 29 </style> 30 </head> 31 <body> 32 <p>Test passes a blue rectangle is in the upper-left corner of a hollow black square.</p> 33 <div id="div1"> 34 <div></div> 35 </div> 36 </body> 37 </html>