1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3
4 <head>
5
6 <title>CSS Test: Collapsing margins - margin-bottom of the last in-flow child block collapsing with its parent min-height block's bottom margin</title>
7
8 <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
9 <link rel="author" title="Bruno Fassino" href="fassino[at]gmail.com">
10 <link rel="help" href="http://www.w3.org/TR/CSS21/changes.html#q313">
11 <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins">
12 <meta content="" name="flags">
13 <meta content="The 'min-height' of a parent block element should have no influence over whether such parent block element's bottom margin is adjoining to its last child's bottom margin. In such situation, the bottom margin of the parent block element and the bottom margin of its last child should collapse as long as such parent block element has no bottom padding and has no bottom border." name="assert">
14
15 <style type="text/css">
16 body {margin: 8px;}
17
18 p {margin: 8px 0px 0px;}
19
20 div#reference-overlapping-green
21 {
22 background-color: green;
23 height: 100px;
24 left: 8px;
25 position: absolute;
26 right: 8px;
27 }
28
29 #test-overlapped-red
30 {
31 background-color: red;
32 min-height: 50px;
33 }
34
35 #last-child
36 {
37 height: 100px;
38 margin-bottom: 100px;
39 }
40 </style>
41
42 </head>
43
44 <body>
45
46 <p>There should be a filled green rectangle across the page and <strong>no red</strong>.</p>
47
48 <div id="reference-overlapping-green"></div>
49
50 <div id="test-overlapped-red">
51 <div id="last-child"></div>
52 </div>
53
54 </body>
55 </html>