margin-collapse-021.xht (1535B)
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 with the 'body' element</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-15 --> 7 <!-- 8 http://lists.w3.org/Archives/Public/public-css-testsuite/2016Apr/0000.html 9 --> 10 <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins" /> 11 <link rel="match" href="margin-collapse-020-ref.xht" /> 12 13 <meta name="flags" content="ahem image" /> 14 <meta name="assert" content="The 'body' element's margins collapse." /> 15 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 16 <style type="text/css"> 17 body 18 { 19 background: url('support/margin-collapse-020.png') no-repeat; 20 font: 20px/1em Ahem; 21 margin: 2em 0 0; 22 } 23 div 24 { 25 background: green; 26 margin-top: 2em; 27 height: 1em; 28 width: 5em; 29 } 30 p 31 { 32 font: 12pt serif; 33 } 34 </style> 35 </head> 36 <body> 37 <div></div> 38 <p>Test passes if there is <strong>no red</strong>.</p> 39 </body> 40 </html>