| OLD | NEW |
| (Empty) |
| 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/st
rict.dtd"> | |
| 2 <html> | |
| 3 | |
| 4 <head> | |
| 5 | |
| 6 <title>CSS Test: Margin collapsing - margins of a 'collapsed through' box with
out clearance can collapse with parent block's bottom margin</title> | |
| 7 | |
| 8 <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins"
> | |
| 9 <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserB
ugsSection/css21testsuite/"> | |
| 10 <link rel="author" title="Daniel Schattenkirchner" href="crazy-daniel{at}gmx.d
e"> | |
| 11 <link rel="match" href="margin-collapse-clear-016-ref.htm"> | |
| 12 | |
| 13 <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"> | |
| 14 <meta content="" name="flags"> | |
| 15 | |
| 16 <style type="text/css"> | |
| 17 body | |
| 18 { | |
| 19 background-color: white; | |
| 20 } | |
| 21 | |
| 22 #parent-block | |
| 23 { | |
| 24 background-color: red; | |
| 25 margin-bottom: 0px; | |
| 26 } | |
| 27 | |
| 28 #sibling | |
| 29 { | |
| 30 background-color: green; | |
| 31 height: 100px; | |
| 32 } | |
| 33 | |
| 34 #element-without-clearance-applied | |
| 35 { | |
| 36 clear: both; | |
| 37 margin-top: 100px; | |
| 38 } | |
| 39 </style> | |
| 40 | |
| 41 </head> | |
| 42 | |
| 43 <body> | |
| 44 | |
| 45 <p>Test passes if there is a wide filled green rectangle and <strong>no red</s
trong>.</p> | |
| 46 | |
| 47 <div id="parent-block"> | |
| 48 <div id="sibling"></div> | |
| 49 <div id="element-without-clearance-applied"></div> | |
| 50 </div> | |
| 51 | |
| 52 <!-- | |
| 53 #element-without-clearance-applied's margin-top collapses | |
| 54 with #parent-block's margin-bottom: the resulting margin-bottom | |
| 55 then collapses with the adjoining white body's margin-bottom | |
| 56 --> | |
| 57 | |
| 58 </body> | |
| 59 </html> | |
| OLD | NEW |