margin-collapse-026.xht (1955B)
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 - in-flow block-level margins with an element 'height' of 'auto' and 'min-height' of zero</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="margin-collapse-002-ref.xht" /> 8 9 <meta name="flags" content="ahem image" /> 10 <meta name="assert" content="An element's margins are adjoining and can collapse if the 'min-height' is zero, if it has no top or bottom borders and no top or bottom padding, if it has a 'height' of zero or 'auto', if it has no line boxes and if all of its in-flow children's margins are adjoining." /> 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-2em-space.png'); 21 height: 4em; 22 } 23 #div3 24 { 25 background: red; 26 height: auto; 27 min-height: 0; 28 } 29 #div2, #div5 30 { 31 background: green; 32 height: 1em; 33 } 34 #div3, #div4 35 { 36 margin-bottom: 2em; 37 margin-top: 2em; 38 } 39 </style> 40 </head> 41 <body> 42 <p>Test passes if there is <strong>no red</strong>.</p> 43 <div id="div1"> 44 <div id="div2"></div> 45 <div id="div3"> 46 <div id="div4"></div> 47 </div> 48 <div id="div5"></div> 49 </div> 50 </body> 51 </html>