block-non-replaced-height-007.xht (1961B)
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' computes 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 through it, and the bottom border edge of the bottommost block-level child that doesn't have margins collapsed through it. When a block-level non-replaced element is in normal flow, 'overflow' computes to 'visible' and the 'height' is 'auto'." /> 8 <style type="text/css"> 9 #div1 10 { 11 position: relative; 12 } 13 #div2, #div3, #div4 14 { 15 width: 1in; 16 } 17 #div2, #div3 18 { 19 background: blue; 20 height: 0.5in; 21 } 22 #div2 23 { 24 border-top: 0.5in solid blue; 25 margin-top: 0.5in; 26 } 27 #div3 28 { 29 border-bottom: 0.5in solid blue; 30 margin-bottom: 0.5in; 31 } 32 #div4 33 { 34 background: blue; 35 height: 2in; 36 left: 1in; 37 position: absolute; 38 top: 0; 39 } 40 </style> 41 </head> 42 <body> 43 <p>Test passes if there is a blue square below.</p> 44 <div id="div1"> 45 <div id="div2"></div> 46 <div id="div3"></div> 47 <div id="div4"></div> 48 </div> 49 </body> 50 </html>