margin-collapse-102.xht (1174B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 2 <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> 3 <head> 4 <title>CSS Test: Margin Collapsing: absolutely positioned</title> 5 <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch"/> 6 <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" /> <!-- 2012-08-15 --> 7 <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/block/margin-collapse/002.html" type="text/html"/> 8 <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"/> 9 <link rel="match" href="../reference/ref-filled-green-100px-square.xht" /> 10 11 <style type="text/css"> 12 div {font-size: 20px;} 13 div.test { background: green; position: absolute; } 14 div.test div { background: red; margin: 5em 2.5em; } 15 div.control { height: 5em; width: 5em; background: red; position: absolute; } 16 </style> 17 </head> 18 <body> 19 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 20 <div class="control"></div> 21 <div class="test"> 22 <div></div> 23 </div> 24 25 26 </body> 27 </html>