margin-collapse-012.xht (1579B)
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 - absolute positioning and siblings</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 8 <meta name="flags" content="ahem image" /> 9 <meta name="assert" content="Absolutely positioned boxes do not collapse margins with siblings." /> 10 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 11 <style type="text/css"> 12 #div1 13 { 14 background: url('support/margin-collapse-2em-space.png') left -1em; 15 border-top: 1em solid green; 16 font: 20px/1em Ahem; 17 height: 3em; 18 width: 5em; 19 } 20 div div 21 { 22 height: 1em; 23 margin-top: 1em; 24 width: 5em; 25 } 26 #div2 27 { 28 height: 0; 29 } 30 #div3 31 { 32 background: green; 33 position: absolute; 34 } 35 </style> 36 <link rel="match" href="margin-collapse-002-ref.xht" /> 37 </head> 38 <body> 39 <p>Test passes if there is <strong>no red</strong>.</p> 40 <div id="div1"> 41 <div id="div2"></div> 42 <div id="div3"></div> 43 </div> 44 </body> 45 </html>