margin-collapse-027.xht (1987B)
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: Margin collapsing - bottom margin not collapse when cleared</title> 5 <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> 6 <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins" /> 7 <link rel="match" href="clearance-006-ref.xht" /> 8 9 <meta name="flags" content="ahem image" /> 10 <meta name="assert" content="When a last sibling has clearance, its own margins collapse and it collapsed its margins with a subsequent sibling, the last sibling does not collapse its bottom margin with its parent's bottom margin." /> 11 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 12 <style type="text/css"> 13 div 14 { 15 font: 20px/1em Ahem; 16 width: 5em; 17 } 18 #div1 19 { 20 background: url('support/margin-collapse-4em-space.png'); 21 height: 6em; 22 } 23 #div2 24 { 25 margin-bottom: 2em; 26 } 27 #div3, #div5 28 { 29 margin-bottom: 1em; 30 } 31 #div3, #div6 32 { 33 background: green; 34 height: 1em; 35 } 36 #div4 37 { 38 float: left; 39 height: 1em; 40 } 41 #div5 42 { 43 clear: both; 44 margin-top: 1.5em; 45 } 46 </style> 47 </head> 48 <body> 49 <p>Test passes if there is no red.</p> 50 <div id="div1"> 51 <div id="div2"> 52 <div id="div3"></div> 53 <div id="div4"></div> 54 <div id="div5"></div> 55 </div> 56 <div id="div6"></div> 57 </div> 58 </body> 59 </html>