margin-collapse-001.xht (1621B)
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 - horizontal margins do not collapse</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-08-14 --> 7 <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins" /> 8 <link rel="match" href="margin-collapse-001-ref.xht" /> 9 10 <meta name="flags" content="ahem" /> 11 <meta name="assert" content="Horizontal margins of element do not collapse." /> 12 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 13 <style type="text/css"> 14 div 15 { 16 font: 20px/1em Ahem; 17 } 18 #test span 19 { 20 color: blue; 21 margin: 5em; 22 } 23 span 24 { 25 color: white; 26 } 27 .color1 28 { 29 color: orange; 30 } 31 </style> 32 </head> 33 <body> 34 <p>Test passes if the blue and orange stripes have the same horizontal spacing between them.</p> 35 <div id="test"> 36 <span>XXXXX</span><span>XXXXX</span> 37 </div> 38 <div id="reference"> 39 <span>XXXXX</span><span class="color1">XXXXX</span><span>XXXXXXXXXX</span><span class="color1">XXXXX</span> 40 </div> 41 </body> 42 </html>