multicol-margin-001

multi-column and margin collapsing of first child (basic)

WeasyPrint

Reference (good) by WeasyPrint

Reference (good) by this browser

This browser

Flags
ahem
Assertion
This test checks that the margin-top of the first child of a multi-column element (with column-fill: auto) does not collapse with its parent.

Source

 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: multi-column and margin collapsing of first child (basic)</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-10 -->
 7   <link rel="help" href="http://www.w3.org/TR/css3-multicol/#pseudo-algorithm" title="3.4 Pseudo-algorithm">
 8   <link rel="match" href="reference/ref-filled-green-100px-square.htm">
 9   <meta name="flags" content="ahem">
10   <meta name="assert" content="This test checks that the margin-top of the first child of a multi-column element (with column-fill: auto) does not collapse with its parent.">
11   <style type="text/css">
12   div#test-multi-column-red
13   {
14   background-color: red;
15   color: white;
16   font: 3.125em/1 Ahem; /* equivalent to 50px/50px Ahem */
17   height: 4em;
18   margin-top: 0em;
19   width: 4em;
20 
21   column-count: 2;
22   column-fill: auto;
23   column-gap: 0em;
24   }
25 
26   div#first-child {margin-top: 2em;}
27 
28   div#reference-overlapping-green
29   {
30   background-color: green;
31   bottom: 200px;
32   height: 100px;
33   position: relative;
34   width: 100px;
35   }
36   </style>
37 
38  </head>
39 
40  <body>
41 
42   <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
43 
44   <div id="test-multi-column-red">
45     <div id="first-child">ab cd</div>
46 	ef gh ij kl
47   </div>
48 
49   <div id="reference-overlapping-green"></div>
50 
51   <!--
52 
53   Expected result (before the overlapping):
54 
55   *********************
56   | margin- |   ef    |
57   | top red |         |
58   | back    |   gh    |
59   | ground  |         |
60   *********************
61   |   ab    |   ij    |
62   |         |         |
63   |   cd    |   kl    |
64   |         |         |
65   *********************
66 
67   -->
68 
69  </body>
70 </html>