| OLD | NEW |
| (Empty) | |
| 1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/x
html1/DTD/xhtml1-strict.dtd"> |
| 2 |
| 3 <html xmlns="http://www.w3.org/1999/xhtml"> |
| 4 |
| 5 <head> |
| 6 |
| 7 <title>CSS Test: Margin collapsing - margins of a 'collapsed through' box with
out clearance can collapse with parent block's bottom margin</title> |
| 8 |
| 9 <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"
/> |
| 10 <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserB
ugsSection/css21testsuite/" /> |
| 11 <link rel="author" title="Daniel Schattenkirchner" href="mailto:crazy-daniel@g
mx.de" /> |
| 12 <link rel="match" href="margin-collapse-clear-016-ref.xht" /> |
| 13 |
| 14 <meta content="An element that does not have clearance applied to it can colla
pse its top margin with its parent block's bottom margin. Margins of a 'collapse
d through' box without clearance applied to it can collapse with its parent bloc
k's bottom margin. An element with clear set to it (to other than 'none') can on
ly create a clearance if and when there is a preceding floated block." name="ass
ert" /> |
| 15 <meta content="" name="flags" /> |
| 16 |
| 17 <style type="text/css"><![CDATA[ |
| 18 body |
| 19 { |
| 20 background-color: white; |
| 21 } |
| 22 |
| 23 #parent-block |
| 24 { |
| 25 background-color: red; |
| 26 margin-bottom: 0px; |
| 27 } |
| 28 |
| 29 #sibling |
| 30 { |
| 31 background-color: green; |
| 32 height: 100px; |
| 33 } |
| 34 |
| 35 #element-without-clearance-applied |
| 36 { |
| 37 clear: both; |
| 38 margin-top: 100px; |
| 39 } |
| 40 ]]></style> |
| 41 |
| 42 </head> |
| 43 |
| 44 <body> |
| 45 |
| 46 <p>Test passes if there is a wide filled green rectangle and <strong>no red</s
trong>.</p> |
| 47 |
| 48 <div id="parent-block"> |
| 49 <div id="sibling"></div> |
| 50 <div id="element-without-clearance-applied"></div> |
| 51 </div> |
| 52 |
| 53 <!-- |
| 54 #element-without-clearance-applied's margin-top collapses |
| 55 with #parent-block's margin-bottom: the resulting margin-bottom |
| 56 then collapses with the adjoining white body's margin-bottom |
| 57 --> |
| 58 |
| 59 </body> |
| 60 </html> |
| OLD | NEW |