block-non-replaced-height-008.xht (2080B)
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: Height determination for block-level non-replaced elements in normal flow when 'overflow' does not compute to 'visible' and elements' margins collapse</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#normal-block" /> 7 <meta name="assert" content="The 'height' is the distance between the top border edge of the top most block-level child box that doesn't have margins collapsed, and the bottom border edge of the bottommost block-level child that doesn't have margins collapsed. When a block-level non-replaced element is in normal flow, 'overflow' does not compute to 'visible' but has been propagated to the viewport and the 'height' is 'auto'." /> 8 <style type="text/css"> 9 html, body 10 { 11 overflow: scroll; 12 } 13 #div1 14 { 15 position: relative; 16 } 17 #div2, #div3, #div4 18 { 19 width: 1in; 20 } 21 #div2, #div3 22 { 23 background: blue; 24 height: 0.5in; 25 } 26 #div2 27 { 28 border-top: 0.5in solid blue; 29 margin-top: 0.5in; 30 } 31 #div3 32 { 33 border-bottom: 0.5in solid blue; 34 margin-bottom: 0.5in; 35 } 36 #div4 37 { 38 background: blue; 39 height: 2in; 40 left: 1in; 41 position: absolute; 42 top: 0; 43 } 44 </style> 45 </head> 46 <body> 47 <p>Test passes if there is a blue square below.</p> 48 <div id="div1"> 49 <div id="div2"></div> 50 <div id="div3"></div> 51 <div id="div4"></div> 52 </div> 53 </body> 54 </html>