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: column-rule and overflow inside (complex test)</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-03 -->
7 <link rel="help" href="http://www.w3.org/TR/css3-multicol/#the-number-and-width-of-columns" title="3. The number and width of columns">
8 <link rel="match" href="reference/multicol-count-computed-003-ref.htm">
9 <meta name="flags" content="ahem">
10 <meta name="assert" content="This test checks that if one of 2 adjacent column boxes (2nd and 3rd colum box in this test) does not have any content, then the column rule separating those should not be drawn. In this test, the 3rd colum box should have no inline content. This test also checks that inline content in the normal flow that extends into a column gap should be clipped in the middle of the column gap. So, in this test, inline content in 1st column box should be partially clipped and overlapped partially by 1st column-rule.">
11 <style type="text/css">
12 div
13 {
14 background: yellow;
15 border: gray solid 1em;
16 color: black;
17 font: 1.25em/1 Ahem;
18 orphans: 1;
19 widows: 1;
20 width: 13em;
21
22 column-gap: 5em;
23 column-rule-color: blue;
24 column-rule-style: solid;
25 column-rule-width: 1.5em;
26 column-width: 1em;
27 }
28
29 /*
30 (15) if (column-width != auto) and (column-count = auto) then
31 (16) N := max(1, floor((available-width + column-gap) / (column-width + column-gap)));
32 (17) W := ((available-width + column-gap) / N) - column-gap;
33 (18) exit;
34
35 N := max(1, floor((available-width + column-gap) / (column-width + column-gap)));
36 N == max(1, floor((13em + 5em) / (1em + 5em)));
37 N == max(1, floor(18em / 6em));
38 N == max(1, floor(3));
39 N == 3;
40
41 So, the used column-count in this test is 3.
42
43 W := ((available-width + column-gap) / N) - column-gap;
44 W == ((13em + 5em) / 3) - 5em;
45 W == ((18em) / 3) - 5em;
46 W == (6em) - 5em;
47 W == 1em;
48
49 So, the used column-width in this test is 1em.
50 */
51
52 #pink {color: pink;}
53 #orange {color: orange;}
54 #purple {color: purple;}
55 #gray {color: gray;}
56
57 /*
58 Since
59 "
60 Content in the normal flow that extends into
61 column gaps (e.g., long words or images) is
62 clipped in the middle of the column gap.
63 "
64 http://www.w3.org/TR/css3-multicol/#overflow-inside-multicol-elements
65 this causes the right-half (0.5em) of the 'K' glyph to
66 be overlapped by the right-half (0.75em) of the 1st blue column-rule.
67 Same thing should happen to the 'N' glyph of 'ORAN'.
68
69 Because no inline content should be rendered into the
70 3rd column box, this causes the 2nd column rule not
71 been rendered because
72 "
73 Column rules are only drawn between two columns that
74 both have content.
75 "
76 http://www.w3.org/TR/css3-multicol/#column-gaps-and-rules
77 */
78 </style>
79 </head>
80
81 <body>
82
83 <div>
84 <span id="pink">PINK</span>
85 <span id="orange">ORAN</span>
86 <span id="purple">PURP</span>
87 <span id="gray">GRAY</span>
88 </div>
89
90 </body>
91 </html>