1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <title>CSS Multi-column Layout Test: multicolumn and margin-bottom collapsing</title>
5 <link rel="author" title="Opera Software ASA" href="http://www.opera.com/">
6 <link rel="reviewer" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/"> <!-- 2013-08-11 -->
7 <link rel="help" href="http://www.w3.org/TR/css3-multicol/#the-multi-column-model" title="2. The multi-column model">
8 <link rel="match" href="reference/multicol-nested-002-ref.htm">
9 <meta name="assert" content="This test checks that a block container element's margin-bottom can collapse with its multi-column parent's margin-bottom if no line boxes, no clearance, no padding and no border separate them.">
10 <meta name="flags" content="ahem">
11 <style type="text/css">
12 body {margin: 0em;}
13
14 body > div
15 {
16 font: 1.25em/1 Ahem;
17 width: 32em;
18
19 column-gap: 1em;
20 column-width: 8em;
21 }
22
23 /*
24
25 N == max(1, floor((available-width + column-gap) / (column-width + column-gap)));
26 N == max(1, floor((32em + 1em) / (8em + 1em)));
27 N == max(1, floor(33em / 9em));
28 N == max(1, floor(3.6));
29 N == max(1, 3);
30 N == 3;
31
32 W == ((available-width + column-gap) / N) - column-gap;
33 W == ((32em + 1em) / 3) - 1em;
34 W == (33em / 3) - 1em;
35 W == (11em) - 1em;
36 W == 10em;
37
38 */
39
40 div
41 {
42 background: yellow;
43 color: black;
44 orphans: 1;
45 widows: 1;
46 }
47
48 div > div {margin: 0 1em 1em;}
49
50 div + div {color: blue;}
51
52 div + div + div {color: pink;}
53 </style>
54 </head>
55
56 <body>
57
58 <div>
59 <div>
60 bl ac
61 bl ac
62 bl ac
63 bl ac
64 </div>
65 <div>
66 bl ue
67 bl ue
68 bl ue
69 bl ue
70 </div>
71 <div>
72 Pi nk
73 Pi nk
74 Pi nk
75 Pi nk
76 </div>
77 </div>
78
79 </body>
80 </html>