clear-clearance-calculation-001.xht (1942B)
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: Clearance calculations - clear box non-collapsing margins with larger margings than clearance</title> 5 <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> 6 <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#flow-control" /> 7 <link rel="match" href="clear-clearance-calculation-001-ref.xht" /> 8 9 <meta name="flags" content="ahem image" /> 10 <meta name="assert" content="When a cleared element has more top margin than the height of the floated element the margin is collpased with previous in-flow children. The element is then placed at the point of the resulting collapsed margin." /> 11 <!-- C1 = H-M2 --> 12 <!-- C2 = Max(M1, M2) - M1 - M2 --> 13 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 14 <style type="text/css"> 15 div 16 { 17 font: 20px/1em Ahem; 18 width: 5em; 19 } 20 #parent 21 { 22 background: url('support/clear-clearance-calculation-001.png'); 23 min-height: 6em; 24 } 25 div div 26 { 27 background: green; 28 height: 1em; 29 } 30 #div1 31 { 32 margin-bottom: 1em; 33 } 34 #div2 35 { 36 float: left; 37 margin: 0; 38 } 39 #div3 40 { 41 clear: left; 42 margin-top: 4em; 43 } 44 </style> 45 </head> 46 <body> 47 <p>Test passes if there is no red.</p> 48 <div id="parent"> 49 <div id="div1"></div> 50 <div id="div2"></div> 51 <div id="div3"></div> 52 </div> 53 </body> 54 </html>