block-formatting-context-height-001.xht (1460B)
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: Block formatting context auto height with floats and bottom margins</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-09-26 --> 7 <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#root-height" /> 8 <link rel="match" href="../reference/ref-filled-black-96px-square.xht" /> 9 10 <meta name="assert" content="The auto height of a block formatting context element is computed by accounting for bottom-margins of floated content which would otherwise be below the bottom edge of that element." /> 11 <style type="text/css"> 12 #container 13 { 14 width: 96px; 15 height: auto; 16 background: black; 17 position: absolute; 18 } 19 #float 20 { 21 float: left; 22 margin-bottom: 48px; 23 height: 48px; 24 width: 100%; 25 } 26 </style> 27 </head> 28 <body> 29 <p>Test passes if there is a filled black square.</p> 30 <div id="container"> 31 <div id="float"></div> 32 </div> 33 </body> 34 </html>