1. Introduction
(This section is not normative.)
This module describes multi-column layout in CSS. By using functionality described in this document, style sheets can declare that the content of an element is to be laid out in multiple columns.
On the Web, tables have also been used to describe multi-column layouts. The main benefit of using CSS-based columns is flexibility; content can flow from one column to another, and the number of columns can vary depending on the size of the viewport. Removing presentation table markup from documents allows them to more easily be presented on various output devices including speech synthesizers and small mobile devices.
Multi-column layouts are easy to describe in CSS. Here is a simple example:
body { column-width: 12em }
In this example, the body
element is
set to have columns at least 12em wide. The exact number of
columns will depend on the available space.
The number of columns can also be set explicitly in the style sheet:
body { column-count: 2 }
In this case, the number of columns is fixed and the column widths will vary depending on the available width.
The shorthand columns property can be used to set either, or both, properties in one declaration.
body { columns: 2 } body { columns: 12em } body { columns: 2 12em }
However, as described below, setting both the width and number of columns rarely makes sense.
Another group of properties introduced in this module describe gaps and rules between columns.
body { column-gap: 1em; column-rule: thin solid black; }
The first declaration in the example above sets the gap between two adjacent columns to be 1em. Column gaps are similar to padding areas. In the middle of the gap there will be a rule which is described by the column-rule property.
The values of the column-rule property are similar to those of the CSS border properties. Like border, column-rule is a shorthand property.
body { column-gap: 1em; column-rule-width: thin; column-rule-style: solid; column-rule-color: black; }
The column-fill and column-span properties give style sheets a wider range of visual expressions in multi-column layouts.
h2
elements are set
to span across all columns.
div { column-fill: balance } h2 { column-span: all }
This specification introduces ten new properties, all of which are used in the examples above.
To indicate where column breaks should (or should not) appear, new keyword values are introduced.
h1
elements will always have a column
break before them, but the formatter will try to avoid column breaks
inside and after the element.
h1 { break-before: column; break-inside: avoid-column; break-after: avoid-column; }
If all column properties have their initial value, the layout of an element will be identical to a multi-column layout with only one column.
2. The multi-column model
A multi-column element (or multicol element for short) is an element whose column-width or column-count property is not auto and therefore acts as a container for multi-column layout.
In the traditional CSS box model, the content of an element is flowed into the content box of the corresponding element. Multi-column layout introduces a new type of container between the content box and the content, namely the column box (or column for short). The content of a multicol element is flowed into its column boxes.
Column boxes in a multi-column element are arranged into rows. Like table cells, the column boxes in a row are ordered in the inline direction of the multicol element. The column width is the length of the column box in the inline direction. The column height is the length of the column box in the block direction. All column boxes in a row have the same column width, and all column boxes in a row have the same column height. Within each row in the multi-column element, adjacent column boxes are separated by a column gap, which may contain a column rule. All column gaps in the same row are equal. All column rules in the same row are also equal, if they appear; column rules only appear between columns that both have content.
In the simplest case a multicol element will contain only one row of columns, and the height of each column will be equivalent to the used height of the multi-column element’s content box.
pqr stu vw xyz. A bc
def g hij klm nopqrs
tuv wxy z. Abc de fg
hi jklmno. Pqrstu vw
x yz. Abc def ghi jkl.
M nop qrst uv wx yz.
Ab cde fgh i jkl. Mno
pqr stu vw xyz. A bc
def g hij klm nopqrs
hi jklmno. Pqrstu vw
x yz. Abc def ghi jkl.
M nop qrst uv wx yz.
Ab cde fgh i jkl. Mno
pqr stu vw xyz. A bc
def g hij klm nopqrs
tuv wxy z. Abc de fg
hi jklmno. Pqrstu vw
x yz. Abc def ghi jkl.
Ab cde fgh i jkl. Mno
pqr stu vw xyz. A bc
def g hij klm nopqrs
tuv wxy z. Abc de fg
hi jklmno. Pqrstu vw
x yz. Abc def ghi jkl.
M nop qrst uv wx yz.
Ab cde fgh i jkl. Mno
Pqr stu vw xyz.
If the multi-column element is paginated, the height of each row is constrained by the page and the content continues in a new row of column boxes on the next page; a column box never splits across pages.
The same effect occurs when a spanning element divides the multi-column element: the columns before the spanning element are balanced and shortened to fit their content. Content after the spanning element then flows into a new row of column boxes.
pqr stu vw xyz. A bc
M nop qrst uv wx yz.
Ab cde fgh i jkl. Mno
pqr stu vw xyz. A bc
def g hij klm nopqrs
tuv wxy z. Abc de fg
hi jklmno. Pqrstu vw
tuv wxy z. Abc de fg
x yz. Abc def ghi jkl.
M nop qrst uv wx yz.
Ab cde fgh i jkl. Mno
pqr stu vw xyz. A bc
def g hij klm nopqrs
tuv wxy z. Abc de fg
x yz. Abc def ghi jkl.
hi jklmno. Pqrstu vw
x yz. Abc def ghi jkl.
M nop qrst uv wx yz.
Ab cde fgh i jkl. Mno
pqr stu vw xyz.
Column boxes are block container boxes. That is, column boxes behave like block-level, table cell, and inline-block boxes as per CSS 2.1, section 10.1, item 2 [CSS21]. However, column boxes do not establish block container boxes for elements with ''position: fixed or position: absolute''.
img { display: block; width: 100% }
Given that the width is calculated relative to the column box, the image will be as wide as the column box:
pqr stu vw xyz. A bc
def g hij klm nopqrs
tuv wxy z. Abc de fg
x yz. Abc def ghi jkl.
M nop qrst uv wx yz.
Ab cde fgh i jkl. Mno
pqr stu vw xyz. A bc
def g hij klm nopqrs
tuv wxy z. Abc de fg
hi jklmno. Pqrstu vw
x yz. Abc def ghi jkl.
M nop qrst uv wx yz.
pqr stu vw xyz. A bc
def g hij klm nopqrs
tuv wxy z. Abc de fg
hi jklmno. Pqrstu vw
x yz. Abc def ghi jkl.
M nop qrst uv wx yz.
Ab cde fgh i jkl. Mno
pqr stu vw xyz.
Floats that appear inside multi-column layouts are positioned with regard to the column box where the float appears.
img { display: block; float: right }
pqr stu vw xyz. A bc
def g
hij klm
nopq
rs tuv
wxy x
yz. Ab
cde fgh i jkl. Mno
pqr stu vw xyz. A bc
tuv wxy z. Abc de fg
hi jklmno. Pqrstu vw
x yz. Abc def ghi jkl.
M nop qrst uv wx yz.
Ab cde fgh i jkl. Mno
pqr stu vw xyz. A bc
def g hij klm nopqrs
tuv wxy z. Abc de fg
hi jklmno. Pqrstu vw
M nop qrst uv wx yz.
Ab cde fgh i jkl. Mno
pqr stu vw xyz. A bc
def g hij klm nopqrs
tuv wxy z. Abc de fg
hi jklmno. Pqrstu vw
x yz. Abc def ghi jkl.
M nop qrst uv wx yz.
The black box represents the image.
A multi-column element establishes a new block formatting context, as per CSS 2.1 section 9.4.1.
Nested multi-column elements are allowed, but there may be implementation-specific limits.
Note: It is not possible to set properties/values on column boxes. For example, the background of a certain column box cannot be set and a column box has no concept of padding, margin or borders. Future specifications may add additional functionality. For example, columns of different widths and different backgrounds may be supported.
Note: Multicol elements with column heights larger than the viewport may pose accessibility issues.
3. The number and width of columns
Finding the number and width of columns is fundamental when laying out multi-column content. These properties are used to set the number and width of columns:
A third property, columns, is a shorthand property which sets both column-width and column-count.
Other factors, such as explicit column breaks, content, and height constraints, may influence the actual number and width of columns.
3.1. column-width
Name: | column-width |
---|---|
Value: | auto | <length> |
Initial: | auto |
Applies to: | block containers except table wrapper boxes |
Inherited: | no |
Percentages: | N/A |
Media: | visual |
Computed value: | the absolute length, zero or larger |
Canonical order: | per grammar |
Animatable: | as <length> |
This property describes the width of columns in multicol elements.
- auto
- means that the column width will be determined by other properties (e.g., column-count, if it has a non-auto value).
- <length>
- describes the optimal column width. The actual column width may be wider (to fill the available space), or narrower (only if the available space is smaller than the specified column width). Specified values must be greater than 0.
div { width: 100px; column-width: 45px; column-gap: 0; column-rule: none; }
There is room for two 45px wide columns inside the 100px wide element. In order to fill the available space the actual column width will be increased to 50px.
div { width: 40px; column-width: 45px; column-gap: 0; column-rule: none; }
The available space is smaller than the specified column width and the actual column width will therefore be decreased.
To ensure that column-width can be used with vertical text, column width means the length of the line boxes inside the columns.
Note: The reason for making column-width somewhat flexible is to achieve scalable designs that can fit many screen sizes. To set an exact column width, the column gap and the width of the multicol element (assuming horizontal text) must also be specified.
3.2. column-count
Name: | column-count |
---|---|
Value: | auto | <integer> |
Initial: | auto |
Applies to: | block containers except table wrapper boxes |
Inherited: | no |
Percentages: | N/A |
Media: | visual |
Computed value: | specified value |
Canonical order: | per grammar |
Animatable: | as <integer> |
This property describes the number of columns of a multicol element.
- auto
- means that the number of columns will be determined by other properties (e.g., column-width, if it has a non-auto value).
- <integer>
- describes the optimal number of columns into which the content of the element will be flowed. Values must be greater than 0. If both column-width and column-count have non-auto values, the integer value describes the maximum number of columns.
3.3. columns
Name: | columns |
---|---|
Value: | <‘column-width’> || <‘column-count’> |
Initial: | see individual properties |
Applies to: | see individual properties |
Inherited: | see individual properties |
Percentages: | see individual properties |
Media: | see individual properties |
Computed value: | see individual properties |
Canonical order: | per grammar |
Animatable: | see individual properties |
This is a shorthand property for setting column-width and column-count. Omitted values are set to their initial values.
columns: 12em; /* column-width: 12em; column-count: auto */ columns: auto 12em; /* column-width: 12em; column-count: auto */ columns: 2; /* column-width: auto; column-count: 2 */ columns: 2 auto; /* column-width: auto; column-count: 2 */ columns: auto; /* column-width: auto; column-count: auto */ columns: auto auto; /* column-width: auto; column-count: auto */
3.4. Pseudo-algorithm
The pseudo-algorithm below determines the used values for column-count (N) and column-width (W) when . There is one other variable in the pseudo-algorithm: U is the used width of the multi-column element.
Note: The used width U of the multi-column element can depend on the element’s contents, in which case it also depends on the computed values of the column-count and column-width properties. This specification does not define how U is calculated. Another module (probably the Basic Box Model [CSS3BOX] or the Intrinsic & Extrinsic Sizing Module [CSS3-SIZING]) is expected to define this.
The floor(X)
function returns the largest integer Y ≤ X.
(01) if ((column-width = auto) and (column-count = auto)) then (02) exit; /* not a multicol element */ (03) if column-width = auto then (04) N := column-count (05) else if column-count = auto then (06) N := max(1, (07) floor((U + column-gap)/(column-width + column-gap))) (08) else (09) N := min(column-count, max(1, (10) floor((U + column-gap)/(column-width + column-gap))))
And:
(11) W := max(0, ((U + column-gap)/N - column-gap))
For the purpose of finding the number of auto-repeated tracks, the UA must floor the track size to a UA-specified value to avoid division by zero. It is suggested that this floor be 1px or less.
In paged media, user agents may perform this calculation on a per-page basis.
The used value for column-count is calculated without regard for explicit column breaks or constrained column heights, while the actual value takes these into consideration.
div { width: 40em; columns: 20em; column-gap: 0 } p { break-after: column } <div> <p>one <p>two <p>three </div>
The computed column-count is auto, the used column-count is 2 and the actual column-count is 3.
div { width: 80em; height: 10em; columns: 20em; column-gap: 0; column-fill: auto; } <div>foo</div>
The computed column-count is auto, the used column-count is 4, and the actual column-count is 1.
3.5. Stacking context
All column boxes in a multi-column element are in the same stacking context and the drawing order of their contents is as specified in CSS 2.1. Column boxes do not establish new stacking contexts.
4. Column gaps and rules
Column gaps and rules are placed between columns in the same multicol element. The length of the column gaps and column rules is equal to the column height. Column gaps take up space. That is, column gaps will push apart content in adjacent columns (within the same multicol element).
A column rule is drawn in the middle of the column gap with the endpoints at opposing content edges of the multicol element. Column rules do not take up space. That is, the presence or thickness of a column rule will not alter the placement of anything else. If a column rule is wider than its gap, the adjacent column boxes will overlap the rule, and the rule may possibly extend outside the box of the multicol element. Column rules are painted in the inline content layer, but below all inline content inside the multicol element. Column rules are only drawn between two columns that both have content.
4.1. column-gap
Name: | column-gap |
---|---|
Value: | <length-percentage> | normal |
Initial: | normal |
Applies to: | multicol elements |
Inherited: | no |
Percentages: | refer to the content width of the multi-column element |
Media: | visual |
Computed value: | as specified, with <length>s made absolute |
Canonical order: | per grammar |
Animation type: | length, percentage, or calc |
column-gap accepting <length-percentage> is at risk, and may be reverted to <length>.
- <length-percentage>
-
Specifies the gap between columns.
If there is a column rule between columns,
it will appear in the middle of the gap.
The <length> or <percentage> cannot be negative.
- normal
- Identical to <length-percentage>, but with a UA-specified length. A value of 1em is suggested.
4.2. column-rule-color
Name: | column-rule-color |
---|---|
Value: | <color> |
Initial: | currentcolor |
Applies to: | multicol elements |
Inherited: | no |
Percentages: | N/A |
Media: | visual |
Computed value: | same as the computed value of color is computed |
Canonical order: | per grammar |
Animatable: | as <color> |
- <color>
- Specifies the color of the column rule.
4.3. column-rule-style
Name: | column-rule-style |
---|---|
Value: | <‘border-style’> |
Initial: | none |
Applies to: | multicol elements |
Inherited: | no |
Percentages: | N/A |
Media: | visual |
Computed value: | specified value |
Canonical order: | per grammar |
Animatable: | no |
The column-rule-style property sets the style of the rule between columns of an element. The <‘border-style’> values are interpreted as in the collapsing border model.
The none value forces the computed value of column-rule-width to be 0.
4.4. column-rule-width
Name: | column-rule-width |
---|---|
Value: | <‘border-width’> |
Initial: | medium |
Applies to: | multicol elements |
Inherited: | no |
Percentages: | N/A |
Media: | visual |
Computed value: | absolute length; 0 if the column rule style is none or |
Canonical order: | per grammar |
Animatable: | as <length> |
This property sets the width of the rule between columns. Negative values are not allowed.
4.5. column-rule
Name: | column-rule |
---|---|
Value: | <‘column-rule-width’> || <‘column-rule-style’> || <‘column-rule-color’> |
Initial: | see individual properties |
Applies to: | see individual properties |
Inherited: | see individual properties |
Percentages: | see individual properties |
Media: | see individual properties |
Computed value: | see individual properties |
Canonical order: | per grammar |
Animatable: | see individual properties |
This property is a shorthand for setting column-rule-width, column-rule-style, and column-rule-color at the same place in the style sheet. Omitted values are set to their initial values.
body { column-gap: 1em; column-rule-width: 1em; column-rule-style: solid; column-rule-color: black; }
5. Column breaks
When content is laid out in multiple columns, the user agent must determine where column breaks are placed. The problem of breaking content into columns is similar to breaking content into pages, which is described in CSS 2.1, section 13.3.3 [CSS21].
Three new properties are introduced to allow column breaks to be described in the same properties as page breaks: break-before, break-after, and break-inside.
5.1. break-before, break-after, break-inside
break-before, break-after, and break-inside are defined in [CSS3-BREAK].
6. Spanning columns
The column-span property makes it possible for an element to span across several columns.
6.1. column-span
Name: | column-span |
---|---|
Value: | none | all |
Initial: | none |
Applies to: | in-flow block-level elements |
Inherited: | no |
Percentages: | N/A |
Media: | visual |
Computed value: | specified value |
Canonical order: | per grammar |
Animation type: | discrete |
This property describes how many columns an element spans across. Values are:
- none
- The element does not span multiple columns.
- all
-
The element spans across all columns of the nearest multicol
ancestor in the same block formatting context.
Content in the normal flow that appears before the
element is automatically balanced across all columns before the
element appears.
The element establishes a new formatting context.
Note: Whether the element establishes a new formatting context does not depend on whether the element is a descendent of a multicol or not. When column-span is all, it always does. This helps with robustness of designs to later revisions that remove the multicol, or when media queries turn the multicol off in some situations.
An element that spans more than one column is called a spanning element and the box it creates is called a spanner.
h2
element has been added to the
sample document after the sixth sentence (i.e., after the word "jkl."). This styling applies:
h2 { column-span: all; background: silver }
By setting column-span to all, all content that appear before
the h2
element is shown before the h2
element.
pqr stu vw xyz. A bc
M nop qrst uv wx yz.
Ab cde fgh i jkl. Mno
pqr stu vw xyz. A bc
def g hij klm nopqrs
tuv wxy z. Abc de fg
hi jklmno. Pqrstu vw
tuv wxy z. Abc de fg
x yz. Abc def ghi jkl.
M nop qrst uv wx yz.
Ab cde fgh i jkl. Mno
pqr stu vw xyz. A bc
def g hij klm nopqrs
tuv wxy z. Abc de fg
x yz. Abc def ghi jkl.
hi jklmno. Pqrstu vw
x yz. Abc def ghi jkl.
M nop qrst uv wx yz.
Ab cde fgh i jkl. Mno
pqr stu vw xyz.
A spanning element takes up more space than the element would take up otherwise. When space is limited, it may be impossible to find room for the spanning element. In these cases, user agents may treat the element as if none had been specified on this property.
pqr stu vw xyz. A bc
def g hij klm nopqrs
tuv wxy z. Abc de fg
hi jklmno. Pqrstu vw
M nop qrst uv wx yz.
Ab cde fgh i jkl. Mno
pqr stu vw xyz. A bc
def g hij klm nopqrs
hi jklmno. Pqrstu vw
x yz. Abc def ghi jkl.
M nop qrst uv wx yz.
Ab cde fgh i jkl. Mno
pqr stu vw xyz. A bc
def g hij klm nopqrs
tuv wxy z. Abc de fg
hi jklmno. Pqrstu vw
M nop qrst uv wx yz.
Ab cde fgh i jkl. Mno
pqr stu vw xyz. A bc
def g hij klm nopqrs
hi jklmno.
nop w rstu vw xyz.
H2
element appears after the fourth paragraph.
This would appear on the first page:
pqr stu vw xyz.
pqr stu vw xyz. A bc
def g hij klm nopqrs
tuv wxy z.
Pq rstu vwxyz.
This would appear on the second page:
pqr stu vw xyz. A bc
M nop qrst uv wx yz.
Ab cde fgh i jkl. Mno
pqr stu vw xyz. A bc
def g hij klm nopqrs
tuv wxy z. Abc de fg
hi jklmno. Pqrstu vw
tuv wxy z. Abc de fg
x yz. Abc def ghi jkl.
M nop qrst uv wx yz.
Ab cde fgh i jkl. Mno
pqr stu vw xyz. A bc
def g hij klm nopqrs
tuv wxy z. Abc de fg
x yz. Abc def ghi jkl.
hi jklmno. Pqrstu vw
x yz. Abc def ghi jkl.
M nop qrst uv wx yz.
Ab cde fgh i jkl. Mno
pqr stu vw xyz.
h2 { margin: 0.5em 0; column-span: all; background: silver } p { margin-top: 1em }
Ab cde fgh i jkl. Mno
pqr stu vw xyz. A bc
def g hij klm nopqrs
tuv wxy z. Abc de fg
hi jklmno. Pqrstu vw
x yz. Abc def ghi jkl.
M nop qrst uv wx yz.
Ab cde fgh i jkl. Mno
pqr stu vw xyz. A bc
def g hij klm nopqrs
tuv wxy z. Abc de fg
hi jklmno. Pqrstu vw
x yz. Abc def ghi jkl.
M nop qrst uv wx yz.
Ab cde fgh i jkl. Mno
pqr stu vw xyz.
7. Filling columns
There are two strategies for filling columns: columns can either be balanced, or not. If columns are balanced, user agents should try to minimize variations in column height, while honoring forced breaks, widows and orphans, and other properties that may affect column heights. If columns are not balanced, they are filled sequentially; some columns may end up partially filled, or with no content at all.
7.1. column-fill
Name: | column-fill |
---|---|
Value: | auto | balance | balance-all |
Initial: | balance |
Applies to: | multicol elements |
Inherited: | no |
Percentages: | N/A |
Media: | see below |
Computed value: | specified value |
Canonical order: | per grammar |
Animation type: | discrete |
The values are:
- balance
- Balance content equally between columns, as far as possible. In paged media, only the last page is balanced.
- balance-all
- Balance content equally between columns, as far as possible. In paged media, all pages are balanced.
- auto
- fill columns sequentially
In continuous media, this property does not have any effect in overflow columns.
article { width: 60em; height: auto; columns: 4; column-fill: balance }
article { width: 60em; height: auto; columns: 4; column-fill: auto }
As a result, the first column is filled with all content:
pqr stu vw xyz. A bc
def g hij klm.
article { width: 60em; height: auto; columns: 4; column-fill: balance } p { break-after: column }
The shortest column height possible contains five lines of text. After the column height has been established, columns are filled sequentially. As a result, the third column is as high as the first two columns, while the last column ends up being significantly shorter.
pqr stu vw xyz. A bc
def g hij klm nopqrs
tuv wxy z. Abc de fg
hi jklmno. Pqrstu vw
M nop qrst uv wx yz.
Ab cde fgh i jkl. Mno
pqr stu vw xyz. A bc
def g hij klm.
pqr stu vw xyz. A bc
def g hij klm nopqrs
tuv wxy z. Abc de fg
hi jklmno. Pqrstu vw
M nop qrst uv wx yz.
article { width: 60em; height: auto; columns: 4; column-fill: balance }
In this example, an article starts with an unbreakable figure which sets the column height. Subsequent content is filled sequentially into the remaining columns:
pqr stu vw xyz. A bc
def g hij klm nopqrs
tuv wxy z. Abc de fg
hi jklmno. Pqrstu vw
x yz. Abc def ghi jkl.
M nop qrst uv wx yz.
pqr stu vw xyz. A bc
def g hij klm nopqrs
tuv wxy z. Abc de fg
hi jklmno.
8. Overflow
8.1. Overflow inside multicol elements
Except for cases where this would cause a column break, content that extends outside column boxes visibly overflows and is not clipped to the column box.
Note: See §5 Column breaks for column breaks and §8.2 Pagination and overflow outside multicol elements for whether it is clipped to the multi-column element’s content box.
sit amet. Nam at jus.
Sed imp er di et ris.
Cur abi tur et sapen.
sit amet. Nam at jus.
Sed imp er di et ris.
Cur abi tur et sapen.
Vivamus a metus.
Aenean at risus
pharetra ante luctu
feugiat quis enim.
Cum sociis natoque
penatibus et magni.
sit amet. Nam at jus.
Sed imp er di et ris.
Cur abi tur et sapen.
Vivamus a metus.
Aenean at risus
pharetra ante luctu
feugiat quis enim.
Cum sociis natoque
penatibus et magni.
8.2. Pagination and overflow outside multicol elements
Content and column rules that extend outside column boxes at the edges of the multi-column element are clipped according to the overflow property.
A multicol element can have more columns than it has room for due to:
- a declaration that constrains the column height (e.g., using height or max-height). In this case, additional column boxes are created in the inline direction
- the size of the page. In this case, additional column boxes are moved to the next page(s).
- explicit column breaks. In this case, additional column boxes are created in the inline direction for continuous media, and additional column boxes are moved to the next page(s) for paged media.
Columns that appear outside the multicol element in continuous media are called overflow columns.
div { max-height: 5em; overflow: visible; }
As a result, the number of columns is increased.
pqr stu vw xyz. A bc
def g hij klm nopqrs
tuv wxy z. Abc de fg
hi jklmno. Pqrstu vw
M nop qrst uv wx yz.
Ab cde fgh i jkl. Mno
pqr stu vw xyz. A bc
def g hij klm nopqrs
hi jklmno. Pqrstu vw
x yz. Abc def ghi jkl.
M nop qrst uv wx yz.
Ab cde fgh i jkl. Mno
def g hij klm nopqrs
tuv wxy z. Abc de fg
hi jklmno. Pqrstu vw
x yz. Abc def ghi jkl.
pqr stu vw xyz. A bc
def g hij klm nopqrs
tuv wxy z. Abc de fg
hi jklmno. Pqrstu vw
M nop qrst uv wx yz.
Ab cde fgh i jkl. Mno
pqr stu vw xyz. A bc
def g hij klm nopqrs
hi jklmno. Pqrstu vw
x yz. Abc def ghi jkl.
M nop qrst uv wx yz.
Ab cde fgh i jkl. Mno
Assuming column balancing, this would appear on the second page:
def g hij klm nopqrs
hi jklmno. Pqrstu vw
p { break-after: column; }
As a result, the number of columns increases and the extra columns are added in the inline direction:
pqr stu vw xyz.
pqr stu vw xyz. A bc
def g hij klm nopqrs
tuv wxyz. Abc defghi
jklmno pqrstu vwxyz.
def g hij klm nopqrs
tuv wxy z.
pqr stu vw xyz.
pqr stu vw xyz. A bc
def g hij klm nopqrs
tuv wxyz. Abc defghi
jklmno pqrstu vwxyz.
This would appear on the second page:
Due to column balancing, the last paragraph is split across three columns.
Appendix B. Changes
This appendix is informative.
This appendix describes changes from the Candidate Recommendation (CR) of 12 April 2011.
- Added July 2016 resolution to change the the track size floor to a required UA-specified value, consistent with the CSS Grid spec.
- Remove the restriction about overflow columns only being in continuous media in the statement that column-fill has no effect on overflow columns. Resolved: September 2013.
- Added keyword balance-all and examples to demonstrate how this should work. Resolved: September 2013.
- The pseudo-algorithm has been revised on a number of occasions. Latest change Feb 2013.
- Clarified that properties columns, column-width, column-count "apply to block containers". Ref: Feb 2013.
- Breaking properties have beeen moved from this specification to the CSS Fragmentation Module.
- Change to column-fill wording to clarify that column-fill is honored before page breaks. Ref: Jan 2012.
- Amended example and text to clarify what happens with margin collapsing and spanning elements. Ref: Oct 2013.
- Clarification that column-rule-width does not alter the size or placement of columns. Ref: Sep 2013.
- Added that each column spanning element establishes a separate BFC margins between them collapse. Ref: Dec 2011.
- Column rules are painted in the inline content layer, but below all inline content inside the multicol. Ref: Feb 2013.
- Clarify that column-span causes the element to establish a formatting context even if it is not in a multicol.
- Column spanners do not always establish a block formatting context.
- Allow column-gap to accept <length-percentage> instead of just <length>
- column-width and column-count applies to block containers except table wrapper boxes.
- Content that overflows columns is not clipped.
Acknowledgments
This document is based on several older proposals and comments on older proposals. Contributors include:
Alex Mogilevsky, Andy Clarke, Anton Prowse, Bert Bos, Björn Höhrmann, Cédric Savarese, Chris Lilley, Chris Wilson, Daniel Glazman and Dave Raggett, David Hyatt, David Singer, David Woolley, Elika Etemad, Giovanni Campagna, Ian Hickson. Joost de Valk, Kevin Lawver, L. David Baron, Markus Mielke, Melinda Grant, Michael Day, Øyvind Stenhaug, Peter Linss, Peter-Paul Koch, Robert O’Callahan, Robert Stevahn, Sergey Genkin, Shelby Moore, Steve Zilles, Sylvain Galineau, Tantek Çelik, Till Halbach,