Sun, 31 Jan 2016 15:42:31 -0800
change //dev.w3.org/csswg/ urls to //drafts.csswg.org/
1 <pre class="metadata">
2 Title: CSS Multi-column Layout Module Level 1
3 Group: CSSWG
4 Shortname: css-multicol
5 Level: 1
6 Status: ED
7 Work Status: Testing
8 ED: https://drafts.csswg.org/css-multicol/
9 TR: http://www.w3.org/TR/css3-multicol/
10 Previous Version: http://www.w3.org/TR/2011/CR-css3-multicol-20110412/
11 Previous Version: http://www.w3.org/TR/2009/CR-css3-multicol-20091217/
12 Previous Version: http://www.w3.org/TR/2009/WD-css3-multicol-20090630/
13 Previous Version: http://www.w3.org/TR/2007/WD-css3-multicol-20070606/
14 Previous Version: http://www.w3.org/TR/2005/WD-css3-multicol-20051215/
15 Previous Version: http://www.w3.org/TR/2001/WD-css3-multicol-20010118/
16 Previous Version: http://www.w3.org/1999/06/WD-css3-multicol-19990623
17 Editor: HÃ¥kon Wium Lie, Opera Software, [email protected]
18 Abstract: This specification describes multi-column layouts in CSS, a style sheet language for the web. Using functionality described in the specification, content can be flowed into multiple columns with a gap and a rule between them.
19 Link Defaults: css-color (property) color, css21 (property) max-height
20 </pre>
22 <style type="text/css">
23 .cols { width: 500px; height: 200px; background: #fff; position: relative; border: solid 5px blue; margin: 0.5em 2em 1em 0; font: bold 14px/19px Arial, sans-serif }
24 .cols p { padding: 3px; margin: 0 }
25 .col { position: absolute; left: 0px; top: 0; z-index: 6; width: 170px }
26 .gap { position: absolute; background: green; width: 5px; bottom: 0px; top: 0px; border: 10px solid yellow; border-top-width: 0; border-bottom-width: 0; }
27 .rep { position: absolute; top: 45px; background: black; height: 110px; width: 100px; color: white; z-index: 4 }
29 table.breaks { border-collapse: collapse; margin: 1em 0 }
30 table.breaks td, table.breaks th { border: thin solid black; padding: 0.1em 0.2em }
32 div.example:before { width: 9em }
33 </style>
35 <h2 id="introduction">
36 Introduction</h2>
38 (This section is not normative.)
40 This module describes multi-column layout in CSS. By using
41 functionality described in this document, style sheets can declare
42 that the content of an element is to be laid out in multiple
43 columns.
45 On the Web, tables have also been used to describe multi-column
46 layouts. The main benefit of using CSS-based columns is flexibility;
47 content can flow from one column to another, and the number of columns
48 can vary depending on the size of the viewport. Removing presentation
49 table markup from documents allows them to more easily be presented on
50 various output devices including speech synthesizers and small mobile
51 devices.
53 Multi-column layouts are easy to describe in CSS. Here is a simple example:
55 <div class=example>
56 <pre>body { column-width: 12em }</pre>
58 In this example, the <code class=html>body</code> element is
59 set to have columns at least ''12em'' wide. The exact number of
60 columns will depend on the available space.
61 </div>
63 The number of columns can also be set explicitly in the style sheet:
65 <div class=example>
66 <pre>body { column-count: 2 }</pre>
68 In this case, the number of columns is fixed and the column widths
69 will vary depending on the available width.
70 </div>
72 The shorthand 'columns' property can be used to set either,
73 or both, properties in one declaration.
75 <div class=example>
76 In these examples, the number of columns, the width of columns, and
77 both the number and width are set, respectively:
79 <pre>
80 body { columns: 2 }
81 body { columns: 12em }
82 body { columns: 2 12em }
83 </pre>
85 However, as described below, setting both the width and number of
86 columns rarely makes sense.
87 </div>
89 Another group of properties introduced in this module describe
90 gaps and rules between columns.
92 <div class=example>
93 <pre>
94 body {
95 column-gap: 1em;
96 column-rule: thin solid black;
97 }
98 </pre>
100 The first declaration in the example above sets the gap between two
101 adjacent columns to be 1em. Column gaps are similar to padding areas.
102 In the middle of the gap there will be a rule which is described by
103 the 'column-rule' property.
104 </div>
106 The values of the 'column-rule' property are similar to those of
107 the CSS border properties. Like 'border', 'column-rule' is a
108 shorthand property.
110 <div class=example>
111 In this example, the shorthand 'column-rule' declaration from the
112 above example has been expanded:
114 <pre>
115 body {
116 column-gap: 1em;
117 column-rule-width: thin;
118 column-rule-style: solid;
119 column-rule-color: black;
120 }
121 </pre>
122 </div>
124 The 'column-fill' and 'column-span' properties give style sheets a
125 wider range of visual expressions in multi-column layouts.
127 <div class=example>
128 In this example, columns are set to be balanced, i.e., to have
129 approximately the same length. Also, <code>h2</code> elements are set
130 to span across all columns.
132 <pre>
133 div { column-fill: balance }
134 h2 { column-span: all }
135 </pre>
136 </div>
138 This specification introduces ten new properties, all of which
139 are used in the examples above.
141 To indicate where column breaks should (or should not) appear, new
142 keyword values are introduced.
144 <div class=example>
145 In this example, <code>h1</code> elements will always have a column
146 break before them, but the formatter will try to avoid column breaks
147 inside and after the element.
149 <pre>
150 h1 {
151 break-before: column;
152 break-inside: avoid-column;
153 break-after: avoid-column;
154 }
155 </pre>
157 <!--
158 The properties and values used in this example are formally defined in [!CSS3PAGE]].
159 -->
160 </div>
162 If all column properties have their initial value, the layout of
163 an element will be identical to a multi-column layout with only one
164 column.
166 <h2 id="the-multi-column-model">
167 The multi-column model</h2>
169 A <dfn lt="multi-column element|multicol element" export>multi-column element</dfn>
170 (or <em>multicol element</em> for short)
171 is an element whose 'column-width' or 'column-count'
172 property is not ''column-width/auto'' and therefore acts as a container for
173 multi-column layout.
175 In the traditional CSS box model, the content of an element is
176 flowed into the content box of the corresponding element. Multi-column
177 layout introduces a new type of container between the content box and
178 the content, namely the <dfn>column box</dfn> (or <em>column</em> for
179 short). The content of a multicol element is flowed into its column
180 boxes.
182 Column boxes in a multi-column element are arranged
183 into <em>rows</em>. Like table cells, the column boxes in a row are
184 ordered in the inline direction of the multicol element. The
185 <em>column width</em> is the length of the column box in the inline
186 direction. The <em>column height</em> is the length of the column box
187 in the block direction. All column boxes in a row have the same column width, and all
188 column boxes in a row have the same column height. Within each row in the multi-column element,
189 adjacent column boxes are separated by a <em>column gap</em>, which
190 may contain a <em>column rule</em>. All column gaps in the same row
191 are equal. All column rules in the same row are also equal, if they
192 appear; column rules only appear between columns that both have
193 content.
195 In the simplest case a multicol element will contain only one row
196 of columns, and the height of each column will be equivalent to the
197 used height of the multi-column element's content box.
199 <div class="example">
200 Column gaps (yellow) and column rules (green) are shown in this
201 sample rendition of a multi-column element with padding (blue). The
202 blue and yellow is present for illustrational purposes only. In actual
203 implementations these areas will be determined by the background.
205 <div class=cols>
206 <div class="col" style="">
207 Ab cde fgh i jkl. Mno<br>
208 pqr stu vw xyz. A bc<br>
209 def g hij klm nopqrs<br>
210 tuv wxy z. Abc de fg<br>
211 hi jklmno. Pqrstu vw<br>
212 x yz. Abc def ghi jkl.<br>
213 M nop qrst uv wx yz.<br>
214 <br>
215 Ab cde fgh i jkl. Mno<br>
216 pqr stu vw xyz. A bc<br>
217 def g hij klm nopqrs
218 </div>
220 <div class="col" style="left: 175px">
221 tuv wxy z. Abc de fg<br>
222 hi jklmno. Pqrstu vw<br>
223 x yz. Abc def ghi jkl.<br>
224 M nop qrst uv wx yz.<br>
225 <br>
226 Ab cde fgh i jkl. Mno<br>
227 pqr stu vw xyz. A bc<br>
228 def g hij klm nopqrs<br>
229 tuv wxy z. Abc de fg<br>
230 hi jklmno. Pqrstu vw<br>
231 x yz. Abc def ghi jkl.<br>
232 </div>
234 <div class="col" style="left: 350px">
235 M nop qrst uv wx yz.<br>
236 <br>
237 Ab cde fgh i jkl. Mno<br>
238 pqr stu vw xyz. A bc<br>
239 def g hij klm nopqrs<br>
240 tuv wxy z. Abc de fg<br>
241 hi jklmno. Pqrstu vw<br>
242 x yz. Abc def ghi jkl.<br>
243 <br>
244 M nop qrst uv wx yz.<br>
245 Ab cde fgh i jkl. Mno<br>
246 Pqr stu vw xyz.
247 </div>
249 <div class=gap style="left: 150px"></div>
250 <div class=gap style="left: 325px"></div>
251 </div>
252 </div>
254 If the multi-column element is paginated, the height of each row is
255 constrained by the page and the content continues in a new row of
256 column boxes on the next page; a column box never splits across pages.
258 The same effect occurs when a <em>spanning element</em> divides the
259 multi-column element: the columns before the spanning element are
260 balanced and shortened to fit their content. Content after the
261 spanning element then flows into a new row of column boxes.
263 <div class="example">
264 <div class=cols>
265 Ab cde fgh i jkl. Mno<br>
266 pqr stu vw xyz. A bc<br>
267 <br>
268 <br>
269 M nop qrst uv wx yz.<br>
270 Ab cde fgh i jkl. Mno<br>
271 pqr stu vw xyz. A bc<br>
272 def g hij klm nopqrs<br>
273 tuv wxy z. Abc de fg<br>
274 hi jklmno. Pqrstu vw<br>
276 <div class="col" style="left: 175px">
277 def g hij klm nopqrs<br>
278 tuv wxy z. Abc de fg<br>
279 <br>
280 <br>
281 x yz. Abc def ghi jkl.<br>
282 M nop qrst uv wx yz.<br>
283 Ab cde fgh i jkl. Mno<br>
284 pqr stu vw xyz. A bc<br>
285 def g hij klm nopqrs<br>
286 tuv wxy z. Abc de fg<br>
287 </div>
289 <div class="col" style="left: 350px">
290 hi jklmno. Pqrstu vw<br>
291 x yz. Abc def ghi jkl.<br>
292 <br>
293 <br>
294 hi jklmno. Pqrstu vw<br>
295 x yz. Abc def ghi jkl.<br>
296 M nop qrst uv wx yz.<br>
297 Ab cde fgh i jkl. Mno<br>
298 pqr stu vw xyz.
299 </div>
301 <div class=rep style="width: 490px; height: 20px; background: silver; font-size: 1.5em; padding: 5px">A spanning element</div>
302 <div class=gap style="left: 150px"></div>
303 <div class=gap style="left: 325px"></div>
304 </div>
305 </div>
307 <!--
308 To illustrate the effects of the various properties described in
309 this specification, variations on a sample document will be used. Here
310 is the source code of the sample document:
312 <pre class="html">
313 <html>
314 <style type="text/css">
315 div {
316 column-width: 15em;
317 column-gap: 2em; /* shown in yellow */
318 column-rule: 4px solid green;
319 padding: 5px; /* shown in blue */
320 }
321 p { margin: 0; padding: 0 }
322 img { display: none }
323 </style>
324 <body>
325 <div>
326 <p>Ab cde fgh i jkl. Mno
327 pqr stu vw xyz. A bc
328 <img src=...>
329 def g hij
330 ...
331 </div>
332 </body>
333 </html>
334 </pre>
336 The nonsensical text in the example is the English alphabet which
337 shows how text flows from one column to another. To simplify the
338 visualization, the textual content of the different examples vary
339 slightly.
340 -->
342 Column boxes are block container boxes. That
343 is, column boxes behave like block-level, table cell, and inline-block
344 boxes as per CSS 2.1, section 10.1, item 2 [[!CSS21]]. However, column
345 boxes do not establish block container boxes for elements with ''position:
346 fixed'' or ''position: absolute''.
348 <div class=example>
349 In this example, the width of the image is set with these rules:
351 <pre class=css>
352 img { display: block; width: 100% }
353 </pre>
355 Given that the width is calculated relative to the column box, the
356 image will be as wide as the column box:
358 <div class=cols>
359 Ab cde fgh i jkl. Mno<br>
360 pqr stu vw xyz. A bc<br>
361 <br>
362 <br>
363 <br>
364 <br>
365 <br>
366 <br>
367 def g hij klm nopqrs<br>
368 tuv wxy z. Abc de fg<br>
370 <div class="col" style="left: 175px">
371 hi jklmno. Pqrstu vw<br>
372 x yz. Abc def ghi jkl.<br>
373 M nop qrst uv wx yz.<br>
374 Ab cde fgh i jkl. Mno<br>
375 pqr stu vw xyz. A bc<br>
376 def g hij klm nopqrs<br>
377 tuv wxy z. Abc de fg<br>
378 hi jklmno. Pqrstu vw<br>
379 x yz. Abc def ghi jkl.<br>
380 M nop qrst uv wx yz.<br>
381 </div>
383 <div class="col" style="left: 350px">
384 Ab cde fgh i jkl. Mno<br>
385 pqr stu vw xyz. A bc<br>
386 def g hij klm nopqrs<br>
387 tuv wxy z. Abc de fg<br>
388 hi jklmno. Pqrstu vw<br>
389 x yz. Abc def ghi jkl.<br>
390 M nop qrst uv wx yz.<br>
391 Ab cde fgh i jkl. Mno<br>
392 pqr stu vw xyz.
393 </div>
395 <div class=rep style="width: 150px"></div>
396 <div class=gap style="left: 150px"></div>
397 <div class=gap style="left: 325px"></div>
398 </div>
399 </div>
401 Floats that appear inside multi-column layouts are positioned with
402 regard to the column box where the float appears.
404 <div class="example">
405 In this example, this CSS fragment describes the presentation of the image:
407 <pre class="css">
408 img { display: block; float: right }
409 </pre>
411 <div class=cols>
412 <div class="col" style="">
413 Ab cde fgh i jkl. Mno<br>
414 pqr stu vw xyz. A bc<br>
415 def g<br>
416 hij klm<br>
417 nopq<br>
418 rs tuv<br>
419 wxy x<br>
420 yz. Ab <br>
421 cde fgh i jkl. Mno<br>
422 pqr stu vw xyz. A bc
423 </div>
425 <div class="col" style="left: 175px">
426 def g hij klm nopqrs<br>
427 tuv wxy z. Abc de fg<br>
428 hi jklmno. Pqrstu vw<br>
429 x yz. Abc def ghi jkl.<br>
430 M nop qrst uv wx yz.<br>
431 Ab cde fgh i jkl. Mno<br>
432 pqr stu vw xyz. A bc<br>
433 def g hij klm nopqrs<br>
434 tuv wxy z. Abc de fg<br>
435 hi jklmno. Pqrstu vw<br>
436 </div>
438 <div class="col" style="left: 350px">
439 x yz. Abc def ghi jkl.<br>
440 M nop qrst uv wx yz.<br>
441 Ab cde fgh i jkl. Mno<br>
442 pqr stu vw xyz. A bc<br>
443 def g hij klm nopqrs<br>
444 tuv wxy z. Abc de fg<br>
445 hi jklmno. Pqrstu vw<br>
446 x yz. Abc def ghi jkl.<br>
447 M nop qrst uv wx yz.<br>
448 </div>
450 <div class=rep style="left: 50px"></div>
452 <div class=gap style="left: 150px"></div>
453 <div class=gap style="left: 325px"></div>
454 </div>
456 The black box represents the image.
457 </div>
459 A multi-column element establishes a new block formatting context,
460 as per CSS 2.1 section 9.4.1.
462 <div class="example">
463 A top margin set on the first child element of a multicol element will not collapse with the margins of the multicol element.
464 </div>
466 Nested multi-column elements are allowed, but there may be
467 implementation-specific limits.
470 Note: It is not possible to set properties/values on column boxes. For
471 example, the background of a certain column box cannot be set and a
472 column box has no concept of padding, margin or borders. Future specifications may add additional
473 functionality. For example, columns of different widths and different
474 backgrounds may be supported.
476 Note: Multicol elements with column heights larger than the viewport may pose accessibility issues.
479 <h2 id="the-number-and-width-of-columns">
480 The number and width of columns</h2>
482 Finding the number and width of columns is fundamental when laying
483 out multi-column content. These properties are used to set the number
484 and width of columns:
486 <!--When the block direction
487 is unconstrained and no column breaks are added through style sheets,
488 these two properties determine the outcome:-->
490 <ul>
491 <li>'column-count'
492 <li>'column-width'
493 </ul>
495 A third property, 'columns', is a shorthand property which sets both
496 'column-width' and 'column-count'.
498 Other factors, such as explicit column breaks, content, and height
499 constraints, may influence the actual number and width of columns.
502 <h3 id='cw'>
503 'column-width'</h3>
505 <pre class=propdef>
506 Name: column-width
507 Value: auto | <<length>>
508 Initial: auto
509 Applies to: non-replaced block-level elements (except table elements), table cells, and inline-block elements
510 Inherited: no
511 Percentages: N/A
512 Media: visual
513 Computed value: the absolute length, zero or larger
514 Animatable: as <<length>>
515 </pre>
517 This property describes the width of columns in multicol elements.
519 <dl dfn-type=value dfn-for=column-width>
520 <dt><dfn>auto</dfn>
521 <dd>
522 means that the column width will be determined by other properties
523 (e.g., 'column-count', if it has a non-auto value).
525 <dt><dfn><<length>></dfn>
526 <dd>
527 describes the optimal column width. The actual column width may be
528 wider (to fill the available space), or narrower (only if the
529 available space is smaller than the specified column width). Specified values
530 must be greater than 0.
531 </dl>
533 <div class=example>
534 For example, consider this style sheet:
536 <pre>
537 div {
538 width: 100px;
539 column-width: 45px;
540 column-gap: 0;
541 column-rule: none;
542 }
543 </pre>
545 There is room for two 45px wide columns inside the 100px wide element. In
546 order to fill the available space the actual column width will be
547 increased to 50px.
548 </div>
550 <div class=example>
551 Also, consider this style sheet:
553 <pre>
554 div {
555 width: 40px;
556 column-width: 45px;
557 column-gap: 0;
558 column-rule: none;
559 }
560 </pre>
562 The available space is smaller than the specified column width and
563 the actual column width will therefore be decreased.
564 </div>
566 To ensure that 'column-width' can be used with vertical text,
567 column width means the length of the line boxes inside the columns.
569 Note: The reason for making 'column-width' somewhat flexible
570 is to achieve scalable designs that can fit many screen sizes. To set
571 an exact column width, the column gap and the width of the multicol
572 element (assuming horizontal text) must also be specified.
575 <h3 id='cc'>
576 'column-count'</h3>
578 <pre class=propdef>
579 Name: column-count
580 Value: auto | <<integer>>
581 Initial: auto
582 Applies to: non-replaced block-level elements (except table elements), table cells, and inline-block elements
583 Inherited: no
584 Percentages: N/A
585 Media: visual
586 Computed value: specified value
587 Animatable: as <<integer>>
588 </pre>
590 This property describes the number of columns of a multicol element.
592 <dl dfn-type=value dfn-for=column-count>
593 <dt><dfn>auto</dfn>
594 <dd>
595 means that the number of columns will be determined by other properties
596 (e.g., 'column-width', if it has a non-auto value).
598 <dt><dfn><<integer>></dfn>
599 <dd>
600 describes the optimal number of columns into which the content of
601 the element will be flowed. Values must be greater than 0. If both
602 'column-width' and 'column-count' have non-auto values, the integer
603 value describes the maximum number of columns.
604 </dl>
607 <div class=example>
608 Example:
610 <pre>body { column-count: 3 }</pre>
611 </div>
614 <h3 id="columns">
615 'columns'</h3>
617 <pre class=propdef>
618 Name: columns
619 Value: <<'column-width'>> || <<'column-count'>>
620 Initial: see individual properties
621 Applies to: see individual properties
622 Inherited: see individual properties
623 Percentages: see individual properties
624 Media: see individual properties
625 Computed value: see individual properties
626 Animatable: see individual properties
627 </pre>
629 This is a shorthand property for setting 'column-width' and
630 'column-count'. Omitted values are set to their initial values.
632 <div class="example">
633 Here are some valid declarations using the 'columns' property:
635 <pre>
636 columns: 12em; /* column-width: 12em; column-count: auto */
637 columns: auto 12em; /* column-width: 12em; column-count: auto */
638 columns: 2; /* column-width: auto; column-count: 2 */
639 columns: 2 auto; /* column-width: auto; column-count: 2 */
640 columns: auto; /* column-width: auto; column-count: auto */
641 columns: auto auto; /* column-width: auto; column-count: auto */
642 </pre>
643 </div>
645 <h3 id="pseudo-algorithm">
646 Pseudo-algorithm</h3>
648 The pseudo-algorithm below determines the used values for
649 'column-count' (N) and 'column-width' (W) when . There is one other variable
650 in the pseudo-algorithm: U is the used width of the multi-column
651 element.
653 Note: The used width U of the multi-column element can depend on the element's contents,
654 in which case it also depends on the computed values of the 'column-count' and 'column-width' properties.
655 This specification does not define how U is calculated.
656 Another module
657 (probably the Basic Box Model [[CSS3BOX]] or the Intrinsic & Extrinsic Sizing Module [[CSS3-SIZING]])
658 is expected to define this.
660 <!--
661 Two assumptions are being made by the pseudo-algorithm:
663 <ul>
664 <li>that the block direction is unconstrained
665 <li>that no column breaks are added through style sheets
666 </ul>
667 -->
669 The <code>floor(X)</code> function returns the largest integer Y ≤ X.
671 <pre>
672 (01) if ((column-width = auto) and (column-count = auto)) then
673 (02) exit; /* not a multicol element */
674 (03) if column-width = auto then
675 (04) N := column-count
676 (05) else if column-count = auto then
677 (06) N := max(1,
678 (07) floor((U + column-gap)/(column-width + column-gap)))
679 (08) else
680 (09) N := min(column-count, max(1,
681 (10) floor((U + column-gap)/(column-width + column-gap))))
682 </pre>
684 And:
686 <pre>
687 (11) W := max(0, ((U + column-gap)/N - column-gap))
688 </pre>
690 In paged media, user agents may perform this calculation on a
691 per-page basis.
693 The used value for 'column-count' is calculated without
694 regard for explicit column breaks or constrained column heights,
695 while the actual value takes these into consideration.
697 <div class=example>
698 In this example, the actual column-count is higher than the used column-count due to explicit column breaks:
700 <pre>
701 div { width: 40em; columns: 20em; column-gap: 0 }
702 p { break-after: column }
704 <div>
705 <p>one
706 <p>two
707 <p>three
708 </div>
709 </pre>
711 The computed column-count is auto, the used column-count is 2 and the actual column-count is 3.
712 </div>
714 <div class=example>
715 The actual column-count may be lower than the used column-count. Consider this example:
717 <pre>
718 div {
719 width: 80em;
720 height: 10em;
721 columns: 20em;
722 column-gap: 0;
723 column-fill: auto;
724 }
726 <div>foo</div>
727 </pre>
729 The computed column-count is auto, the used column-count is 4, and the actual column-count is 1.
730 </div>
732 <h3 id="stacking-context">
733 Stacking context</h3>
735 All column boxes in a multi-column element are in the same stacking
736 context and the drawing order of their contents is as specified in
737 CSS 2.1. Column boxes do not establish new stacking contexts.
739 <h2 id="column-gaps-and-rules">
740 Column gaps and rules</h2>
742 Column gaps and rules are placed between columns in the same
743 multicol element. The length of the column gaps and column rules
744 is equal to the column height. Column gaps take up space. That
745 is, column gaps will push apart content in adjacent columns (within
746 the same multicol element).
748 A column rule is drawn in the middle of the column gap with the
749 endpoints at opposing content edges of the multicol element. Column
750 rules do not take up space. That is, the presence or thickness of a
751 column rule will not alter the placement of anything else. If a column
752 rule is wider than its gap, the adjacent column boxes will overlap the
753 rule, and the rule may possibly extend outside the box of the multicol
754 element. Column rules are painted in the inline content layer, but
755 below all inline content inside the multicol element. Column rules are
756 only drawn between two columns that both have content.
758 <h3 id='column-gap'>
759 'column-gap'</h3>
761 <pre class=propdef>
762 Name: column-gap
763 Value: <<length>> | normal
764 Initial: normal
765 Applies to: <a>multicol elements</a>
766 Inherited: no
767 Percentages: N/A
768 Media: visual
769 Computed value: absolute length or ''normal''
770 Animatable: as <<length>>
771 </pre>
773 <dl dfn-type=value dfn-for=column-gap>
774 <dt><dfn><<length>></dfn>
775 <dd>
776 Specifies the gap between columns.
777 If there is a column rule between columns,
778 it will appear in the middle of the gap.
780 The <<length>> cannot be negative.
782 <dt><dfn>normal</dfn>
783 <dd>
784 Identical to <a value for="column-gap"><length></a>,
785 but with a UA-specified length.
786 A value of ''1em'' is suggested.
787 </dl>
790 <h3 id='crc'>
791 'column-rule-color'</h3>
793 <pre class=propdef>
794 Name: column-rule-color
795 Value: <<color>>
796 Initial: currentcolor
797 Applies to: multicol elements
798 Inherited: no
799 Percentages: N/A
800 Media: visual
801 Computed value: same as the computed value of 'color' is computed
802 Animatable: as <<color>>
803 </pre>
805 <dl>
806 <dt><dfn value for=column-rule-color><<color>></dfn>
807 <dd>
808 Specifies the color of the column rule.
809 </dl>
812 <h3 id='crs'>
813 'column-rule-style'</h3>
815 <pre class=propdef>
816 Name: column-rule-style
817 Value: <<'border-style'>>
818 Initial: none
819 Applies to: multicol elements
820 Inherited: no
821 Percentages: N/A
822 Media: visual
823 Computed value: specified value
824 Animatable: no
825 </pre>
827 The 'column-rule-style' property sets the style of the rule between columns of an element.
828 The <<'border-style'>> values are interpreted as in the <a href="http://www.w3.org/TR/CSS2/tables.html#collapsing-borders">collapsing border model</a>.
830 The ''border-style/none'' value forces the computed value of 'column-rule-width' to be ''0''.
833 <h3 id='crw'>
834 'column-rule-width'</h3>
836 <pre class=propdef>
837 Name: column-rule-width
838 Value: <<'border-width'>>
839 Initial: medium
840 Applies to: multicol elements
841 Inherited: no
842 Percentages: N/A
843 Media: visual
844 Computed value: absolute length; ''0'' if the column rule style is ''none'' or ''hidden''
845 Animatable: as <<length>>
846 </pre>
848 This property sets the width of the rule between columns.
849 Negative values are not allowed.
852 <h3 id="column-rule">
853 'column-rule'</h3>
855 <pre class=propdef>
856 Name: column-rule
857 Value: <<'column-rule-width'>> || <<'column-rule-style'>> || <<'column-rule-color'>>
858 Initial: see individual properties
859 Applies to: see individual properties
860 Inherited: see individual properties
861 Percentages: see individual properties
862 Media: see individual properties
863 Computed value: see individual properties
864 Animatable: see individual properties
865 </pre>
867 This property is a shorthand for setting
868 'column-rule-width', 'column-rule-style', and 'column-rule-color' at
869 the same place in the style sheet. Omitted values are set to their
870 initial values.
872 <div class=example>
873 In this example, the column rule and the column gap have the same
874 width. Therefore, they will occupy exactly the same space.
876 <pre>
877 body {
878 column-gap: 1em;
879 column-rule-width: 1em;
880 column-rule-style: solid;
881 column-rule-color: black;
882 }
883 </pre>
884 </div>
887 <div class=example>
888 If a tall image is moved to a column on the next page to find room
889 for it, its natural column may be left empty. If so, the column is
890 still considered to have content for the purpose of deciding if the
891 column rule should be drawn.
892 </div>
894 <h2 id="column-breaks">
895 Column breaks</h2>
897 When content is laid out in multiple columns, the user agent must
898 determine where column breaks are placed. The problem of breaking
899 content into columns is similar to breaking content into pages, which
900 is described in CSS 2.1, section 13.3.3 [[!CSS21]].
902 Three new properties are introduced to allow column breaks to be
903 described in the same properties as page breaks: 'break-before',
904 'break-after', and 'break-inside'.
907 <h3 id="break-before-break-after-break-inside">
908 'break-before', 'break-after', 'break-inside'</h3>
910 'break-before', 'break-after', and 'break-inside'
911 are defined in [[!CSS3-BREAK]].
913 <h2 id="spanning-columns">
914 Spanning columns</h2>
916 The 'column-span' property makes it possible for an element to span across several columns.
919 <h3 id="column-span">
920 'column-span'</h3>
922 <pre class="propdef">
923 Name: column-span
924 Value: none | all
925 Initial: none
926 Applies to: in-flow block-level elements
927 Inherited: no
928 Percentages: N/A
929 Media: visual
930 Computed value: specified value
931 </pre>
933 This property describes how many columns an element spans across. Values are:
935 <dl dfn-type=value dfn-for=column-span>
936 <dt><dfn>none</dfn>
937 <dd>
938 The element does not span multiple columns.
940 <dt><dfn>all</dfn>
941 <dd>
942 The element spans across all columns of the nearest multicol
943 ancestor in the same block formatting context. The element spans
944 across all columns. Content in the normal flow that appears before the
945 element is automatically balanced across all columns before the
946 element appears. The element establishes a new block formatting
947 context.
948 </dl>
950 An element that spans more than one column is called a
951 <dfn export>spanning element</dfn> and the box it creates is called a <dfn export>spanner</dfn>.
953 <!--
954 This property has no effect on elements that do not fit entirely
955 within the multicol element. Also, if a setting on this property pushes the
956 element outside a multicol element, this property will have no effect.
957 -->
959 <div class="example">
960 In this example, an <code>h2</code> element has been added to the
961 sample document after the sixth sentence (i.e., after the word "jkl."). This styling applies:
963 <pre class="css">
964 h2 { column-span: all; background: silver }
965 </pre>
967 By setting 'column-span' to ''column-span/all'', all content that appear before
968 the <code>h2</code> element is shown before the <code>h2</code>
969 element.
971 <div class=cols>
972 Ab cde fgh i jkl. Mno<br>
973 pqr stu vw xyz. A bc<br>
974 <br><br>
975 M nop qrst uv wx yz.<br>
976 Ab cde fgh i jkl. Mno<br>
977 pqr stu vw xyz. A bc<br>
978 def g hij klm nopqrs<br>
979 tuv wxy z. Abc de fg<br>
980 hi jklmno. Pqrstu vw<br>
982 <div class="col" style="left: 175px">
983 def g hij klm nopqrs<br>
984 tuv wxy z. Abc de fg<br>
985 <br><br>
986 x yz. Abc def ghi jkl.<br>
987 M nop qrst uv wx yz.<br>
988 Ab cde fgh i jkl. Mno<br>
989 pqr stu vw xyz. A bc<br>
990 def g hij klm nopqrs<br>
991 tuv wxy z. Abc de fg<br>
992 </div>
994 <div class="col" style="left: 350px">
995 hi jklmno. Pqrstu vw<br>
996 x yz. Abc def ghi jkl.<br>
997 <br><br>
998 hi jklmno. Pqrstu vw<br>
999 x yz. Abc def ghi jkl.<br>
1000 M nop qrst uv wx yz.<br>
1001 Ab cde fgh i jkl. Mno<br>
1002 pqr stu vw xyz.
1003 </div>
1005 <div class=rep style="width: 490px; height: 20px; background: silver; font-size: 1.5em; padding: 5px">An H2 element</div>
1006 <div class=gap style="left: 150px"></div>
1007 <div class=gap style="left: 325px"></div>
1008 </div>
1009 </div>
1011 A spanning element takes up more space than the element would take
1012 up otherwise. When space is limited, it may be impossible to find room
1013 for the spanning element. In these cases, user agents may treat the
1014 element as if ''column-span/none'' had been specified on this property.
1016 <div class="example">
1017 In this example, the
1018 H2 element appears later in the content, and the height of the
1019 multicol element is constrained. Therefore, the H2 element appears in
1020 the overflow and there is not room to make the element spanning.
1021 As a result, the element appears as if 'column-span: none' was
1022 specified.
1024 <div class=cols style="height: 100px">
1025 <div class="col" style="">
1026 Ab cde fgh i jkl. Mno<br>
1027 pqr stu vw xyz. A bc<br>
1028 def g hij klm nopqrs<br>
1029 tuv wxy z. Abc de fg<br>
1030 hi jklmno. Pqrstu vw<br>
1031 </div>
1033 <div class="col" style="left: 175px">
1034 x yz. Abc def ghi jkl.<br>
1035 M nop qrst uv wx yz.<br>
1036 Ab cde fgh i jkl. Mno<br>
1037 pqr stu vw xyz. A bc<br>
1038 def g hij klm nopqrs
1039 </div>
1041 <div class="col" style="left: 350px">
1042 tuv wxy z. Abc de fg<br>
1043 hi jklmno. Pqrstu vw<br>
1044 x yz. Abc def ghi jkl.<br>
1045 M nop qrst uv wx yz.<br>
1046 Ab cde fgh i jkl. Mno<br>
1047 </div>
1049 <div class="col" style="left: 525px">
1050 pqr stu vw xyz.
1051 <div class=rep style="width: 140px; height: 40px; background: silver; font-size: 1.5em; padding: 5px; margin: 0; position: static">An H2 element</div>
1052 A bc def g hij klm
1053 </div>
1055 <div class="col" style="left: 700px">
1056 nopqrs tuv wxy z.
1057 </div>
1059 <div class=gap style="left: 150px"></div>
1060 <div class=gap style="left: 325px"></div>
1061 <div class=gap style="left: 500px"></div>
1062 <div class=gap style="left: 675px"></div>
1063 </div>
1064 </div>
1066 <div class="example">
1067 This example is similar to the previous example,
1068 except that the H2 element appears naturally in the last column.
1069 Still, there is not enough room to make the element spanning.
1071 <div class=cols style="height: 100px">
1072 <div class="col" style="">
1073 Ab cde fgh i jkl. Mno<br>
1074 pqr stu vw xyz. A bc<br>
1075 def g hij klm nopqrs<br>
1076 tuv wxy z. Abc de fg<br>
1077 hi jklmno. Pqrstu vw<br>
1078 </div>
1080 <div class="col" style="left: 175px">
1081 x yz. Abc def ghi jkl.<br>
1082 M nop qrst uv wx yz.<br>
1083 Ab cde fgh i jkl. Mno<br>
1084 pqr stu vw xyz. A bc<br>
1085 def g hij klm nopqrs
1086 </div>
1088 <div class="col" style="left: 350px">
1089 tuv wxy z. Abc de fg<br>
1090 hi jklmno.
1091 <div class=rep style="width: 140px; height: 40px; background: silver; font-size: 1.5em; padding: 5px; margin: 0; position: static">An H2 element</div>
1092 </div>
1094 <div class="col" style="left: 525px">
1095 A bc def g hij klm<br>
1096 nop w rstu vw xyz.
1097 </div>
1099 <div class=gap style="left: 150px"></div>
1100 <div class=gap style="left: 325px"></div>
1101 <div class=gap style="left: 500px"></div>
1102 </div>
1103 </div>
1105 <div class="example">
1106 In paged media spanning elements are honored on all pages.
1107 In this example, the first three paragraphs have column breaks after them.
1108 An spanning <code>H2</code> element appears after the fourth paragraph.
1109 This would appear on the first page:
1111 <div class=cols style="height: 80px; border-bottom: none">
1112 <div class="col" style="">
1113 Ab cde fgh i jkl. Mno<br>
1114 pqr stu vw xyz.
1115 </div>
1117 <div class="col" style="left: 175px">
1118 Ab cde fgh i jkl. Mno<br>
1119 pqr stu vw xyz. A bc<br>
1120 def g hij klm nopqrs<br>
1121 tuv wxy z.
1122 </div>
1124 <div class="col" style="left: 350px">
1125 Ab cde fgh i jkl mno.<br>
1126 Pq rstu vwxyz.
1127 </div>
1129 <div class=gap style="left: 150px"></div>
1130 <div class=gap style="left: 325px"></div>
1131 </div>
1133 This would appear on the second page:
1135 <div class=cols style="height: 200px; border-top: none">
1136 Ab cde fgh i jkl. Mno<br>
1137 pqr stu vw xyz. A bc<br>
1138 <br><br>
1139 M nop qrst uv wx yz.<br>
1140 Ab cde fgh i jkl. Mno<br>
1141 pqr stu vw xyz. A bc<br>
1142 def g hij klm nopqrs<br>
1143 tuv wxy z. Abc de fg<br>
1144 hi jklmno. Pqrstu vw<br>
1146 <div class="col" style="left: 175px">
1147 def g hij klm nopqrs<br>
1148 tuv wxy z. Abc de fg<br>
1149 <br><br>
1150 x yz. Abc def ghi jkl.<br>
1151 M nop qrst uv wx yz.<br>
1152 Ab cde fgh i jkl. Mno<br>
1153 pqr stu vw xyz. A bc<br>
1154 def g hij klm nopqrs<br>
1155 tuv wxy z. Abc de fg<br>
1156 </div>
1158 <div class="col" style="left: 350px">
1159 hi jklmno. Pqrstu vw<br>
1160 x yz. Abc def ghi jkl.<br>
1161 <br><br>
1162 hi jklmno. Pqrstu vw<br>
1163 x yz. Abc def ghi jkl.<br>
1164 M nop qrst uv wx yz.<br>
1165 Ab cde fgh i jkl. Mno<br>
1166 pqr stu vw xyz.
1167 </div>
1169 <div class=rep style="width: 490px; height: 20px; background: silver; font-size: 1.5em; padding: 5px">An H2 element</div>
1170 <div class=gap style="left: 150px"></div>
1171 <div class=gap style="left: 325px"></div>
1172 </div>
1173 </div>
1175 <div class="example">
1176 Spanners create new block formatting contexts, but their margins
1177 can be changed by their surroundings. In this example, two spanners
1178 naturally end up at the top of a page. The top margin of the first
1179 spanner is truncated due to adjoining an unforced break. The margins
1180 between the two spanners collapse with each other. However, the bottom
1181 margin of the second spanner does not collapse with the top margin of
1182 the subsequent element.
1184 <pre>
1185 h2 {
1186 margin: 0.5em 0;
1187 column-span: all;
1188 background: silver
1189 }
1190 p { margin-top: 1em }
1191 </pre>
1193 <div class=cols style="border-top: none">
1194 <br><br><br><br>
1195 <br>
1196 Ab cde fgh i jkl. Mno<br>
1197 pqr stu vw xyz. A bc<br>
1198 def g hij klm nopqrs<br>
1199 tuv wxy z. Abc de fg<br>
1200 hi jklmno. Pqrstu vw<br>
1202 <div class="col" style="left: 175px">
1203 <br><br><br><br>
1204 x yz. Abc def ghi jkl.<br>
1205 M nop qrst uv wx yz.<br>
1206 Ab cde fgh i jkl. Mno<br>
1207 pqr stu vw xyz. A bc<br>
1208 def g hij klm nopqrs<br>
1209 tuv wxy z. Abc de fg<br>
1210 </div>
1212 <div class="col" style="left: 350px">
1213 <br><br><br><br>
1214 hi jklmno. Pqrstu vw<br>
1215 x yz. Abc def ghi jkl.<br>
1216 M nop qrst uv wx yz.<br>
1217 Ab cde fgh i jkl. Mno<br>
1218 pqr stu vw xyz.
1219 </div>
1221 <div class=rep style="width: 490px; top: 0; height: 20px; background: silver; font-size: 1.5em; padding: 5px">An H2 element</div>
1222 <div class=rep style="width: 490px; top: 40px; height: 20px; background: silver; font-size: 1.5em; padding: 5px">Another H2 element</div>
1223 <div class=gap style="top: 80px; left: 150px"></div>
1224 <div class=gap style="top: 80px; left: 325px"></div>
1225 </div>
1226 </div>
1230 <h2 id="filling-columns">
1231 Filling columns</h2>
1233 There are two strategies for filling columns: columns can either be
1234 balanced, or not. If columns are balanced, user agents should try to
1235 minimize variations in column height, while honoring forced breaks,
1236 'widows' and 'orphans', and other properties that may affect column
1237 heights. If columns are not balanced, they are filled sequentially;
1238 some columns may end up partially filled, or with no content at all.
1241 <h3 id='cf'>
1242 'column-fill'</h3>
1244 <pre class="propdef">
1245 Name: column-fill
1246 Value: auto | balance | balance-all
1247 Initial: balance
1248 Applies to: multicol elements
1249 Inherited: no
1250 Percentages: N/A
1251 Media: see below
1252 Computed value: specified value
1253 </pre>
1255 The values are:
1257 <dl dfn-type=value dfn-for=column-fill>
1258 <dt><dfn>balance</dfn>
1259 <dd>
1260 Balance content equally between columns, as far as possible.
1261 In paged media, only the last page is balanced.
1263 <dt><dfn>balance-all</dfn>
1264 <dd>
1265 Balance content equally between columns, as far as possible.
1266 In paged media, all pages are balanced.
1268 <dt><dfn>auto</dfn>
1269 <dd>
1270 fill columns sequentially
1271 </dl>
1273 <!--
1274 In continuous media, this property will only be consulted if the
1275 length of columns has been constrained. Otherwise, columns will
1276 automatically be balanced.
1277 -->
1279 In continuous media, this property does not have any effect in
1280 overflow columns.
1282 <!--
1283 In paged media, this property will only have
1284 effect on the last page the multicol element appears on.
1285 -->
1287 <div class=example>
1288 In this example, an article only has one short paragraph which fits
1289 on three lines. The three lines are displayed in three different
1290 columns due to column balancing.
1292 <pre>
1293 article { width: 60em; height: auto; columns: 4; column-fill: balance }
1294 </pre>
1296 <div class=cols style="width: 675px; height: 25px">
1297 <div class="col" style="">
1298 Ab cde fgh i jkl. Mno<br>
1299 </div>
1301 <div class="col" style="left: 175px">
1302 pqr stu vw xyz. A bc
1303 </div>
1305 <div class="col" style="left: 350px">
1306 def g hij klm.
1307 </div>
1309 <div class="col" style="left: 525px">
1310 </div>
1312 <div class=gap style="left: 150px"></div>
1313 <div class=gap style="left: 325px"></div>
1314 <div class=gap style="left: 500px"></div>
1315 </div>
1316 </div>
1318 <div class=example>
1319 In this example, column balancing is turned off:
1321 <pre>
1322 article { width: 60em; height: auto; columns: 4; column-fill: auto }
1323 </pre>
1325 As a result, the first column is filled with all content:
1327 <div class=cols style="width: 675px; height: 60px">
1328 <div class="col" style="">
1329 Ab cde fgh i jkl. Mno<br>
1330 pqr stu vw xyz. A bc<br>
1331 def g hij klm.
1332 </div>
1334 <div class="col" style="left: 175px">
1335 </div>
1337 <div class="col" style="left: 350px">
1338 </div>
1340 <div class="col" style="left: 525px">
1341 </div>
1343 <div class=gap style="left: 150px"></div>
1344 <div class=gap style="left: 325px"></div>
1345 <div class=gap style="left: 500px"></div>
1346 </div>
1347 </div>
1349 <div class=example>
1350 In this example, an article has two paragraphs: first a long one, then a shorter one. This code is applied:
1352 <pre>
1353 article { width: 60em; height: auto; columns: 4; column-fill: balance }
1354 p { break-after: column }
1355 </pre>
1357 The shortest column height possible contains five lines of text.
1358 After the column height has been established, columns are filled sequentially.
1359 As a result, the third column is as high as the first two columns,
1360 while the last column ends up being significantly shorter.
1362 <div class=cols style="width: 675px; height: 100px">
1363 <div class="col" style="">
1364 Ab cde fgh i jkl. Mno<br>
1365 pqr stu vw xyz. A bc<br>
1366 def g hij klm nopqrs<br>
1367 tuv wxy z. Abc de fg<br>
1368 hi jklmno. Pqrstu vw<br>
1369 </div>
1371 <div class="col" style="left: 175px">
1372 x yz. Abc def ghi jkl.<br>
1373 M nop qrst uv wx yz.<br>
1374 Ab cde fgh i jkl. Mno<br>
1375 pqr stu vw xyz. A bc<br>
1376 def g hij klm.
1377 </div>
1379 <div class="col" style="left: 350px">
1380 Ab cde fgh i jkl. Mno<br>
1381 pqr stu vw xyz. A bc<br>
1382 def g hij klm nopqrs<br>
1383 tuv wxy z. Abc de fg<br>
1384 hi jklmno. Pqrstu vw<br>
1385 </div>
1387 <div class="col" style="left: 525px">
1388 x yz. Abc def ghi jkl.<br>
1389 M nop qrst uv wx yz.
1390 </div>
1392 <div class=gap style="left: 150px"></div>
1393 <div class=gap style="left: 325px"></div>
1394 <div class=gap style="left: 500px"></div>
1395 </div>
1396 </div>
1398 <div class=example>
1399 <pre>
1400 article { width: 60em; height: auto; columns: 4; column-fill: balance }
1401 </pre>
1403 In this example, an article starts with an unbreakable figure which sets the column height.
1404 Subsequent content is filled sequentially into the remaining columns:
1406 <div class=cols style="width: 675px; height: 140px">
1407 <div class="col" style="">
1408 </div>
1410 <div class="col" style="left: 175px">
1411 Ab cde fgh i jkl. Mno<br>
1412 pqr stu vw xyz. A bc<br>
1413 def g hij klm nopqrs<br>
1414 tuv wxy z. Abc de fg<br>
1415 hi jklmno. Pqrstu vw<br>
1416 x yz. Abc def ghi jkl.<br>
1417 M nop qrst uv wx yz.<br>
1418 </div>
1420 <div class="col" style="left: 350px">
1421 Ab cde fgh i jkl. Mno<br>
1422 pqr stu vw xyz. A bc<br>
1423 def g hij klm nopqrs<br>
1424 tuv wxy z. Abc de fg<br>
1425 hi jklmno.
1426 </div>
1428 <div class="col" style="left: 525px">
1429 </div>
1431 <div class=rep style="top: 0; width: 150px; height: 140px"></div>
1432 <div class=gap style="left: 150px"></div>
1433 <div class=gap style="left: 325px"></div>
1434 <div class=gap style="left: 500px"></div>
1435 </div>
1436 </div>
1440 <h2 id="overflow">
1441 Overflow</h2>
1443 <h3 id="overflow-inside-multicol-elements">
1444 Overflow inside multicol elements</h3>
1446 <!--Floated or in-flow content that extends into column gaps (e.g.,
1447 long words or images) is clipped in the middle of the column gap.-->
1449 Floated or in-flow content that extends into column gaps or neighboring columns — e.g.,
1450 long words or images — is not clipped and may therefore cause overflow.
1452 <div class=example>
1453 In this example, the image is wider than the column:
1455 <div class=cols>
1456 Lorem ipsum dolor<br>sit amet. Nam at jus.
1457 <br><br><br><br><br><br><br>
1458 Sed imp er di et ris.<br>Cur abi tur et sapen.
1460 <div style="position: absolute; left: 175px; top: 0; z-index: 6;">
1461 Lorem ipsum dolor<br>sit amet. Nam at jus.<br>
1462 Sed imp er di et ris.<br>Cur abi tur et sapen.<br>
1463 Vivamus a metus.<br> Aenean at risus<br> pharetra ante
1464 luctu<br> feugiat quis enim.<br> Cum sociis natoque<br>
1465 penatibus et magni.
1466 </div>
1468 <div style="position: absolute; left: 350px; top: 0; z-index: 6;">
1469 Lorem ipsum dolor<br>sit amet. Nam at jus.<br>
1470 Sed imp er di et ris.<br>Cur abi tur et sapen.<br>
1471 Vivamus a metus.<br> Aenean at risus<br> pharetra ante
1472 luctu<br> feugiat quis enim.<br> Cum sociis natoque<br>
1473 penatibus et magni.
1474 </div>
1476 <div class=rep style="width: 183px"></div>
1477 <div class=gap style="left: 150px"></div>
1478 <div class=gap style="left: 325px"></div>
1479 </div>
1480 </div>
1483 <h3 id="pagination-and-overflow-outside-multicol">
1484 Pagination and overflow outside multicol elements</h3>
1486 Content and column rules that extend outside column boxes at
1487 the edges of the multi-column element are clipped according to the
1488 'overflow' property.
1490 A multicol element can have more columns than it has room for due to:
1492 <ul>
1493 <li>
1494 a declaration that constrains the column height (e.g., using
1495 'height' or 'max-height'). In this case, additional column boxes
1496 are created in the inline direction
1498 <li>
1499 the size of the page. In this case, additional column boxes are
1500 moved to the next page(s).
1502 <li>
1503 explicit column breaks. In this case, additional column boxes are
1504 created in the inline direction for continuous media, and
1505 additional column boxes are moved to the next page(s) for paged
1506 media.
1507 </ul>
1509 Columns that appear outside the multicol element in continuous media
1510 are called <dfn>overflow columns</dfn>.
1512 <div class="example">
1513 In this example, the height of the multi-column element has been
1514 constrained to a maximum height. Also, the style sheet specifies that
1515 overflowing content should be visible:
1517 <pre>
1518 div {
1519 max-height: 5em;
1520 overflow: visible;
1521 }
1522 </pre>
1524 As a result, the number of columns is increased.
1526 <div class=cols style="height: 100px">
1527 <div class="col" style="">
1528 Ab cde fgh i jkl. Mno<br>
1529 pqr stu vw xyz. A bc<br>
1530 def g hij klm nopqrs<br>
1531 tuv wxy z. Abc de fg<br>
1532 hi jklmno. Pqrstu vw<br>
1533 </div>
1535 <div class="col" style="left: 175px">
1536 x yz. Abc def ghi jkl.<br>
1537 M nop qrst uv wx yz.<br>
1538 Ab cde fgh i jkl. Mno<br>
1539 pqr stu vw xyz. A bc<br>
1540 def g hij klm nopqrs
1541 </div>
1543 <div class="col" style="left: 350px">
1544 tuv wxy z. Abc de fg<br>
1545 hi jklmno. Pqrstu vw<br>
1546 x yz. Abc def ghi jkl.<br>
1547 M nop qrst uv wx yz.<br>
1548 Ab cde fgh i jkl. Mno<br>
1549 </div>
1551 <div class="col" style="left: 525px">
1552 pqr stu vw xyz. A bc<br>
1553 def g hij klm nopqrs<br>
1554 tuv wxy z. Abc de fg<br>
1555 hi jklmno. Pqrstu vw<br>
1556 x yz. Abc def ghi jkl.<br>
1557 </div>
1559 <div class=gap style="left: 150px"></div>
1560 <div class=gap style="left: 325px"></div>
1561 <div class=gap style="left: 500px"></div>
1562 </div>
1563 </div>
1565 <div class="example">
1566 In paged media, the overflow content goes into column on subsequent pages.
1567 Given the same content as in the previous example
1568 and a page box that only has room for five lines of formatted text,
1569 this would appear on the first page:
1571 <div class=cols style="height: 100px; border-bottom: none">
1572 <div class="col" style="">
1573 Ab cde fgh i jkl. Mno<br>
1574 pqr stu vw xyz. A bc<br>
1575 def g hij klm nopqrs<br>
1576 tuv wxy z. Abc de fg<br>
1577 hi jklmno. Pqrstu vw<br>
1578 </div>
1580 <div class="col" style="left: 175px">
1581 x yz. Abc def ghi jkl.<br>
1582 M nop qrst uv wx yz.<br>
1583 Ab cde fgh i jkl. Mno<br>
1584 pqr stu vw xyz. A bc<br>
1585 def g hij klm nopqrs
1586 </div>
1588 <div class="col" style="left: 350px">
1589 tuv wxy z. Abc de fg<br>
1590 hi jklmno. Pqrstu vw<br>
1591 x yz. Abc def ghi jkl.<br>
1592 M nop qrst uv wx yz.<br>
1593 Ab cde fgh i jkl. Mno<br>
1594 </div>
1596 <div class=gap style="left: 150px"></div>
1597 <div class=gap style="left: 325px"></div>
1598 </div>
1600 Assuming column balancing, this would appear on the second page:
1602 <div class=cols style="height: 45px; border-top: none">
1603 <div class="col" style="">
1604 pqr stu vw xyz. A bc<br>
1605 def g hij klm nopqrs<br>
1606 </div>
1608 <div class="col" style="left: 175px">
1609 tuv wxy z. Abc de fg<br>
1610 hi jklmno. Pqrstu vw<br>
1611 </div>
1613 <div class="col" style="left: 350px">
1614 x yz. Abc def ghi jkl.<br>
1615 </div>
1617 <div class=gap style="left: 150px"></div>
1618 <div class=gap style="left: 325px"></div>
1619 </div>
1620 </div>
1622 <div class="example">
1623 In this example, explicit column breaks are generated after paragraphs:
1625 <pre>
1626 p {
1627 break-after: column;
1628 }
1629 </pre>
1631 As a result, the number of columns increases and the extra columns
1632 are added in the inline direction:
1634 <div class=cols style="height: 100px">
1635 <div class="col" style="">
1636 Ab cde fgh i jkl. Mno<br>
1637 pqr stu vw xyz.
1638 </div>
1640 <div class="col" style="left: 175px">
1641 Ab cde fgh i jkl. Mno<br>
1642 pqr stu vw xyz. A bc<br>
1643 def g hij klm nopqrs<br>
1644 tuv wxyz. Abc defghi<br>
1645 jklmno pqrstu vwxyz.
1646 </div>
1648 <div class="col" style="left: 350px">
1649 Ab cde fgh i jkl mno.<br>
1650 </div>
1652 <div class="col" style="left: 525px">
1653 Pqr stu vw xyz. A bc<br>
1654 def g hij klm nopqrs<br>
1655 tuv wxy z.
1656 </div>
1658 <div class=gap style="left: 150px"></div>
1659 <div class=gap style="left: 325px"></div>
1660 <div class=gap style="left: 500px"></div>
1661 </div>
1662 </div>
1664 <div class="example">
1665 In paged media, extra columns are shown on the next page.
1666 Given the same code as the previous example,
1667 the last paragraph appears on the second page.
1668 This would appear on the first page:
1670 <div class=cols style="height: 100px; border-bottom: none">
1671 <div class="col" style="">
1672 Ab cde fgh i jkl. Mno<br>
1673 pqr stu vw xyz.
1674 </div>
1676 <div class="col" style="left: 175px">
1677 Ab cde fgh i jkl. Mno<br>
1678 pqr stu vw xyz. A bc<br>
1679 def g hij klm nopqrs<br>
1680 tuv wxyz. Abc defghi<br>
1681 jklmno pqrstu vwxyz.
1682 </div>
1684 <div class="col" style="left: 350px">
1685 Ab cde fgh i jkl mno.<br>
1686 </div>
1688 <div class=gap style="left: 150px"></div>
1689 <div class=gap style="left: 325px"></div>
1690 </div>
1692 This would appear on the second page:
1694 <div class=cols style="height: 23px; border-top: none">
1695 <div class="col" style="">
1696 Pqr stu vw xyz. A bc
1697 </div>
1699 <div class="col" style="left: 175px">
1700 def g hij klm nopqrs
1701 </div>
1703 <div class="col" style="left: 350px">
1704 tuv wxy z.
1705 </div>
1707 <div class=gap style="left: 150px"></div>
1708 <div class=gap style="left: 325px"></div>
1709 </div>
1711 Due to column balancing, the last paragraph is split across three columns.
1712 </div>
1714 <h2 class=no-num id=acknowledgments>
1715 Acknowledgments</h2>
1717 This document is based on several older proposals and comments on older proposals.
1718 Contributors include:
1720 Alex Mogilevsky,
1721 Andy Clarke,
1722 Anton Prowse,
1723 Bert Bos,
1724 Björn Höhrmann,
1725 Cédric Savarese,
1726 Chris Lilley,
1727 Chris Wilson,
1728 Daniel Glazman and
1729 Dave Raggett,
1730 David Hyatt,
1731 David Singer,
1732 David Woolley,
1733 Elika Etemad,
1734 Giovanni Campagna,
1735 Ian Hickson.
1736 Joost de Valk,
1737 Kevin Lawver,
1738 L. David Baron,
1739 Markus Mielke,
1740 Melinda Grant,
1741 Michael Day,
1742 Ãyvind Stenhaug,
1743 Peter Linss,
1744 Peter-Paul Koch,
1745 Robert O'Callahan,
1746 Robert Stevahn,
1747 Sergey Genkin,
1748 Shelby Moore,
1749 Steve Zilles,
1750 Sylvain Galineau,
1751 Tantek Ãelik,
1752 Till Halbach,