CSS Multi-column Layout Module Level 2
CSS Multi-column Layout Module Level 2
Editor’s Draft
16 February 2026
More details about this document
This version:
Latest published version:
Previous Versions:
Feedback:
CSSWG Issues Repository
Inline In Spec
Editors:
Florian Rivoal
On behalf of Bloomberg
Rachel Andrew
Google
Former Editor:
Håkon Wium Lie
Opera Software
Suggest an Edit for this Spec:
GitHub Editor
Test Suite:
World Wide Web Consortium
W3C
liability
trademark
and
permissive document license
rules apply.
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.
CSS
is a language for describing the rendering of structured documents
(such as HTML and XML)
on screen, on paper, etc.
Status of this document
This is a public copy of the editors’ draft.
It is provided for discussion only and may change at any moment.
Its publication here does not imply endorsement of its contents by W3C.
Don’t cite this document other than as work in progress.
Please send feedback
by
filing issues in GitHub
(preferred),
including the spec code “css-multicol” in the title, like this:
“[css-multicol]
…summary of comment…
”.
All issues and comments are
archived
Alternately, feedback can be sent to the (
archived
) public mailing list
www-style@w3.org
This document is governed by the
18 August 2025 W3C Process Document
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.
Other layout methods in CSS,
when applied to a parent element,
change the display properties of the direct children.
For example if a three column grid layout is created,
the direct children of the
grid container
become
grid items
and are placed into the column tracks,
one element per cell with additional rows created as needed.
The child elements of a
multi-column container
however continue in normal flow,
that flow is arranged into a number of columns.
These columns have a flexible inline size,
and therefore respond to available space
by changing the size or number of columns displayed.
Multi-column layouts are easy to describe in CSS.
Here is a simple example:
body
column-width
12
em
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
In this case, the number of columns is fixed
and the column widths will vary depending on the available width.
If a
column-height
is set,
and there is more content that will fit in one row of columns at the specified height,
multiple rows of columns are created in the block direction.
body
column-height
10
em
column-count
In this case, the number of columns is fixed
and the column widths will vary depending on the available width.
If there is more content than will fit into three columns of height 10em,
a new row of columns is created in the block direction.
The shorthand
columns
property can be used to set all three properties in one declaration.
In these examples, the number of columns, the width of columns, and
both the number and width of columns,
and the width and height of columns are set, respectively:
body
columns
body
columns
12
em
body
columns
12
em
body
columns
12
em
14
em
The
column-fill
and
column-span
properties
give style sheets a wider range of visual expressions in multi-column layouts.
In this example, columns are set to be balanced,
i.e., to have approximately the same length.
Also,
h2
elements are set to span across all columns.
div
column-fill
balance
h2
column-span
all
Tests
multicol-fill-balance-029.html
(live test)
(source)
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.
Column gaps
(diagonal hatching) and
column rules
are shown in this sample rendition of a multi-column container
with padding (cross hatching).
The hatched areas are present for illustrational purposes only.
In actual implementations these areas will be determined by the background,
the second image shows a rendering of a
multi-column container
with column-rules.
A multi-column layout with the non-visible column-span and padding inside the multicol container highlighted.
The same layout as in the first image, as it would be displayed by an implementation.
1.1.
Value Definitions
This specification follows the
CSS property definition conventions
from
[CSS21]
using the
value definition syntax
from
[CSS-VALUES-3]
Value types not defined in this specification are defined in CSS Values & Units
[CSS-VALUES-3]
Combination with other CSS modules may expand the definitions of these value types.
In addition to the property-specific values listed in their definitions,
all properties defined in this specification
also accept the
CSS-wide keywords
as their property value.
For readability they have not been repeated explicitly.
2.
Module Interactions
This document defines new features not present in earlier specifications.
In addition, once final, it will replace and supersede the following:
The
CSS Multi-Column Layout Module Level 1
3.
The multi-column model
An element whose
column-width
column-count
, or
column-height
property is not
auto
establishes a
multi-column container
(or
multicol container
for short),
and therefore acts as a container for
multi-column layout
Tests
Basic multicol tests.
multicol-basic-002.html
(live test)
(source)
multicol-basic-004.html
(live test)
(source)
Tests demonstrating that auto values do not create a multicol container.
multicol-count-computed-004.xht
(live test)
(source)
Multicol properties do not inherit.
inheritance.html
(live test)
(source)
Multicol with scrolled columns.
multicol-scroll-content.html
(live test)
(source)
Multicol with zero height.
multicol-zero-height-001.xht
(live test)
(source)
multicol-zero-height-002.html
(live test)
(source)
multicol-zero-height-003.html
(live test)
(source)
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
fragmentation context
formed of
anonymous
fragmentation containers
called
column boxes
(or
columns
for short).
These
column boxes
establish
an independent
block formatting context
into which the multi-column container’s content flows,
and form the
containing block
for its non-positioned children.
In this example, the width of the image is set with these rules:
img
display
block
width
100
Given that the column box creates a new
block formatting context
the
width
is calculated relative to the column box.
Therefore the image will not overflow the column box:
The image is constrained by the column box that it is displayed in.
Given that the column box creates a new
block formatting context
, a top margin set on the first child element of a multicol container will not collapse with the margins of the multicol container.
The margin above the first paragraph has not collapsed, leaving a
1em
margin above the first line in the multicol container.
Tests
multicol-margin-001.xht
(live test)
(source)
multicol-margin-002.xht
(live test)
(source)
multicol-margin-003.html
(live test)
(source)
multicol-margin-child-001.xht
(live test)
(source)
multicol-nested-margin-001.xht
(live test)
(source)
multicol-nested-margin-002.xht
(live test)
(source)
multicol-nested-margin-003.xht
(live test)
(source)
multicol-nested-margin-004.xht
(live test)
(source)
multicol-nested-margin-005.xht
(live test)
(source)
multicol-collapsing-001.xht
(live test)
(source)
Floats that appear inside multi-column layouts are positioned with
regard to the
column box
where the float appears.
In this example, this CSS fragment describes the presentation of the image:
img
display
block
float
right
In the HTML, the image appears after the sentence ending, "the leg of a chicken".
The image is floated inside the column box it appears in.
Content overflowing a
column box
in the
block axis
fragments
and continues in the next
column box
Note:
Column boxes, which are
anonymous boxes
do not become the
containing block
for
absolutely positioned boxes
The
position
property, which establishes a containing block for such boxes,
applies to the
multicol container
, it being the
principal box
Tests
multicol-containing-001.xht
(live test)
(source)
multicol-containing-002.xht
(live test)
(source)
multicol-containing-003.html
(live test)
(source)
multicol-contained-absolute.html
(live test)
(source)
abspos-autopos-contained-by-viewport-000.html
(live test)
(source)
abspos-autopos-contained-by-viewport-001.html
(live test)
(source)
abspos-multicol-in-second-outer-clipped.html
(live test)
(source)
In this example, the
multi-column container
has
position: relative
thus becoming the containing block.
The image is a direct child of the
multi-column container
and has
position: absolute
It takes positioning from the
multi-column container
and not from the
column box
.container
position
relative
column-count
img
position
absolute
top
20
px
left
40
px
The figure demonstrates that the absolutely positioned image is positioned by reference to the multicol container and not the column box.
Out-of-flow
descendants of a
multi-column container
do affect column balancing,
and the block-size of the
multi-column container
Tests
multicol-oof-inline-cb-001.html
(live test)
(source)
multicol-oof-inline-cb-002.html
(live test)
(source)
The column boxes are ordered
in the
inline base direction
of the multicol container
and arranged into
multicol rows
A multicol row contains at least one
multicol line
or spanning 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 line have the same column width,
and all column boxes in a line have the same column height.
Tests
The following tests relate to baseline alignment of the content of columns,
though this is not defined in this specification.
baseline-000.html
(live test)
(source)
baseline-001.html
(live test)
(source)
baseline-002.html
(live test)
(source)
baseline-003.html
(live test)
(source)
baseline-004.html
(live test)
(source)
baseline-005.html
(live test)
(source)
baseline-006.html
(live test)
(source)
baseline-007.html
(live test)
(source)
baseline-008.html
(live test)
(source)
as-baseline-aligned-grid-item.html
(live test)
(source)
The following tests check the behavior of list items that are also muticol containers.
multicol-list-item-001.xht
(live test)
(source)
multicol-list-item-002.html
(live test)
(source)
multicol-list-item-003.html
(live test)
(source)
multicol-list-item-004.html
(live test)
(source)
multicol-list-item-005.html
(live test)
(source)
multicol-list-item-006.html
(live test)
(source)
multicol-list-item-007.html
(live test)
(source)
multicol-list-item-008.html
(live test)
(source)
Testing grid items inside multicol
balance-grid-001.html
(live test)
(source)
The following tests check the behavior of table elements.
multicol-table-cell-001.xht
(live test)
(source)
multicol-table-cell-height-001.xht
(live test)
(source)
multicol-table-cell-height-002.xht
(live test)
(source)
multicol-table-cell-vertical-align-001.xht
(live test)
(source)
table-cell-as-multicol.html
(live test)
(source)
table-cell-content-change-000.html
(live test)
(source)
table-cell-content-change-001.html
(live test)
(source)
table-cell-multicol-nested-001.html
(live test)
(source)
table-cell-multicol-nested-002.html
(live test)
(source)
table-cell-multicol-nested-003.html
(live test)
(source)
break-before-multicol-caption.html
(live test)
(source)
repeated-table-column.html
(live test)
(source)
table-cell-writing-mode-root.html
(live test)
(source)
balance-breakafter-before-table-section-crash.html
(live test)
(source)
balance-table-with-border-spacing.html
(live test)
(source)
balance-table-with-fractional-height-row.html
(live test)
(source)
The following tests check that paint order is correct.
float-and-block.html
(live test)
(source)
move-with-text-after-paint.html
(live test)
(source)
resize-with-text-after-paint.html
(live test)
(source)
The following tests relate to animation or transformation of multicol properties.
column-width-interpolation.html
(live test)
(source)
discrete-no-interpolation.html
(live test)
(source)
multicol-overflow-positioned-transform-001.html
(live test)
(source)
multicol-overflow-transform-001.html
(live test)
(source)
resize-multicol-with-fixed-size-children.html
(live test)
(source)
resize-multicol-with-fixed-size-children-002.html
(live test)
(source)
resize-multicol-with-fixed-size-children-003.html
(live test)
(source)
resize-in-strict-containment-nested.html
(live test)
(source)
remove-child-in-strict-containment-also-spanner.html
(live test)
(source)
composited-under-clip-under-multicol.html
(live test)
(source)
change-intrinsic-width.html
(live test)
(source)
change-fragmentainer-size-000.html
(live test)
(source)
change-fragmentainer-size-001.html
(live test)
(source)
change-fragmentainer-size-002.html
(live test)
(source)
change-fragmentainer-size-003.html
(live test)
(source)
hit-test-child-under-perspective.html
(live test)
(source)
hit-test-transformed-child.html
(live test)
(source)
Tests related to implementation bugs, not linked to specific normative text.
multicol-with-monolithic-oof-with-multicol-with-oof.html
(live test)
(source)
chrome-bug-1293905.html
(live test)
(source)
chrome-bug-1297118.html
(live test)
(source)
chrome-bug-1301281.html
(live test)
(source)
chrome-bug-1303256.html
(live test)
(source)
chrome-bug-1314866.html
(live test)
(source)
dynamic-simplified-layout-break-propagation.html
(live test)
(source)
float-multicol-crash.html
(live test)
(source)
change-abspos-width-in-second-column-crash.html
(live test)
(source)
change-out-of-flow-type-and-remove-inner-multicol-crash.html
(live test)
(source)
monolithic-oof-in-clipped-container.html
(live test)
(source)
move-linebreak-to-different-column.html
(live test)
(source)
move-newline-pre-text.html
(live test)
(source)
multicol-at-page-boundary-print.html
(live test)
(source)
multicol-block-in-inline-crash.html
(live test)
(source)
multicol-cached-consumed-bsize-crash.html
(live test)
(source)
multicol-column-change-crash.html
(live test)
(source)
multicol-dynamic-contain-crash.html
(live test)
(source)
multicol-dynamic-transform-crash.html
(live test)
(source)
multicol-floats-in-ifc.html
(live test)
(source)
multicol-parallel-flow-after-spanner-in-inline.html
(live test)
(source)
outline-move-oof-with-inline.html
(live test)
(source)
relpos-inline-with-abspos-multicol-gets-block-child.html
(live test)
(source)
size-containment-become-multicol-add-inline-child.html
(live test)
(source)
sticky-in-abs-in-sticky.html
(live test)
(source)
text-box-trim-end-and-widows.html
(live test)
(source)
vertical-rl-column-rules-wide-columns.html
(live test)
(source)
video-container-become-multicol.html
(live test)
(source)
dynamic-become-multicol-add-oof-inside-inline-crash.html
(live test)
(source)
extremely-tall-multicol-with-extremely-tall-child-crash.html
(live test)
(source)
file-control-crash.html
(live test)
(source)
img-alt-as-multicol-crash.html
(live test)
(source)
multicol-loads-indefinitely-001-crash.html
(live test)
(source)
multicol-on-broken-image-alt-text.html
(live test)
(source)
overflow-scroll-in-multicol-crash.html
(live test)
(source)
remove-block-sibling-of-inline-with-block-crash.html
(live test)
(source)
subpixel-column-progression.html
(live test)
(source)
subpixel-scroll-crash.html
(live test)
(source)
text-child-crash.html
(live test)
(source)
with-custom-layout-on-same-element-crash.https.html
(live test)
(source)
oof-in-area-001.html
(live test)
(source)
oof-in-area-002.html
(live test)
(source)
oof-in-area-003.html
(live test)
(source)
oof-in-oof-multicol-in-multicol-spanner-in-multicol.html
(live test)
(source)
oof-in-oof-multicol-in-relpos-in-oof-in-multicol-in-multicol.html
(live test)
(source)
oof-in-oof-multicol-in-relpos-spanner-in-multicol-in-relpos-multicol-in-multicol.html
(live test)
(source)
oof-in-oof-multicol-in-relpos-spanner-in-spanner-multicol-in-multicol-in-multicol.html
(live test)
(source)
oof-in-oof-multicol-in-spanner-in-multicol-in-spanner-in-nested-multicol.html
(live test)
(source)
oof-in-oof-multicol-in-spanner-in-nested-multicol.html
(live test)
(source)
oof-in-relpos-in-oof-multicol-in-oof-in-relpos-in-oof-multicol-in-multicol.html
(live test)
(source)
oof-in-relpos-in-oof-multicol-in-relpos-in-oof-multicol-in-relpos-multicol.html
(live test)
(source)
floated-input-in-inline-next-column.html
(live test)
(source)
inline-float-parallel-flow.html
(live test)
(source)
table-caption-in-clipped-overflow.html
(live test)
(source)
text-in-inline-interrupted-by-float.html
(live test)
(source)
increase-prev-sibling-height.html
(live test)
(source)
interleaved-bfc-crash.html
(live test)
(source)
relayout-fixedpos-in-abspos-in-relpos-in-nested-multicol.html
(live test)
(source)
inline-become-oof-container-make-oof-inflow.html
(live test)
(source)
multicol-dynamic-change-inside-break-inside-avoid-001.html
(live test)
(source)
multicol-dynamic-add-001.html
(live test)
(source)
multicol-dynamic-add-002.html
(live test)
(source)
multicol-dynamic-add-003.html
(live test)
(source)
multicol-dynamic-add-004.html
(live test)
(source)
scroll-width-height.tentative.html
(live test)
(source)
filter-with-abspos.html
(live test)
(source)
add-list-item-marker.html
(live test)
(source)
block-in-inline-with-abspos-after-spanner.html
(live test)
(source)
block-in-inline-with-spanner-in-overflowed-parent.html
(live test)
(source)
block-in-inline-with-spanner-in-overflowed-parent-nested-multicol.html
(live test)
(source)
first-letter-column-span-fieldset.html
(live test)
(source)
triply-nested-partial-relayout.html
(live test)
(source)
Tests related to printing and paged media as related to multicol.
auto-fill-auto-size-001-print.html
(live test)
(source)
auto-fill-auto-size-002-print.html
(live test)
(source)
multicol-height-002-print.xht
(live test)
(source)
named-page.html
(live test)
(source)
page-property-ignored.html
(live test)
(source)
Note:
In text set using a vertical writing mode,
the block direction runs horizontally.
In a vertical writing mode columns are laid out horizontally,
and the direction of the flow of blocks may be right to left, or left to right.
The
column-width
property therefore refers to the inline size of the column,
and not the physical horizontal width.
A diagram showing the different ways columns may be arranged due to writing mode.
From left to right: horizontal-tb, vertical-rl, vertical-lr.
Tests
Tests regarding vertical writing modes.
orthogonal-writing-mode-shrink-to-fit.html
(live test)
(source)
multicol-under-vertical-rl-scroll.html
(live test)
(source)
hit-test-in-vertical-rl.html
(live test)
(source)
In the inline direction, within each
multicol line
in the multi-column container,
adjacent column boxes are separated by a
column gap
which may contain a
column rule
In the block direction,
column rows
are separated by a
row gap
which may contain a
row rule
All column gaps in the same multi-column container are equal.
All column rules in the same multi-column container are also equal, if they appear;
column rules only appear between columns that both have content.
In the simplest case a multicol container will contain only one line of columns,
inside one multicol row, and the height of each column will be equivalent to the
used height of the multi-column container’s content box.
However,
fragmentation
or
spanners
can split the content of the
multicol row
into multiple
multicol lines
If the multi-column container is paginated, the height of each column is
constrained by the page and the content continues in a new line of
column boxes on the next page; a column box never splits across pages.
If a multi-column container in continuous media is set to wrap,
the height of each column is defined by the
column-height
property.
If there is more content than will fit in a single row a new multicol row is created
in the block direction, with columns of the size defined by the
column-height
property.
If a row is only partially filled with content,
the size defined by
column-height
is still maintained with empty space following the content.
When a
spanning element
divides the
multi-column container: a new multicol line is created.
The columns before the spanning element are
balanced and shortened to fit their content. Content after the
spanning element then flows into a new, subsequent multicol line of column boxes.
A demonstration of how the spanning element divides the multicol container.
If the spanning element is larger in the block direction than the space available in the current multicol row,
the row geometry is maintained. The spanner is allowed to cross the row boundary,
over any gap, and into the next row.
multi-column container
therefore is a regular
block container
that establishes a new
independent formatting context
whose contents consist of one or more
multicol rows
, containing
multicol lines
and multicol spanners.
Each
multi-column line
acts as a
block-level box
that establishes a
multi-column formatting context
for its
column boxes
and each
spanner
acts as a
block-level box
that establishes an
independent formatting context
with its type depending on its
display
value as usual.
Nested multi-column containers are allowed,
but there may be implementation-specific limits.
Tests
multicol-nested-002.xht
(live test)
(source)
multicol-nested-005.xht
(live test)
(source)
multicol-nested-006.html
(live test)
(source)
multicol-nested-007.html
(live test)
(source)
multicol-nested-008.html
(live test)
(source)
multicol-nested-009.html
(live test)
(source)
multicol-nested-010.html
(live test)
(source)
multicol-nested-011.html
(live test)
(source)
multicol-nested-012.html
(live test)
(source)
multicol-nested-013.html
(live test)
(source)
multicol-nested-014.html
(live test)
(source)
multicol-nested-015.html
(live test)
(source)
multicol-nested-016.html
(live test)
(source)
multicol-nested-017.html
(live test)
(source)
multicol-nested-018.html
(live test)
(source)
multicol-nested-019.html
(live test)
(source)
multicol-nested-020.html
(live test)
(source)
multicol-nested-021.html
(live test)
(source)
multicol-nested-022.html
(live test)
(source)
multicol-nested-023.html
(live test)
(source)
multicol-nested-024.html
(live test)
(source)
multicol-nested-025.html
(live test)
(source)
multicol-nested-026.html
(live test)
(source)
multicol-nested-027.html
(live test)
(source)
multicol-nested-028.html
(live test)
(source)
multicol-nested-029.html
(live test)
(source)
multicol-nested-030.html
(live test)
(source)
multicol-nested-031.html
(live test)
(source)
multicol-nested-032.html
(live test)
(source)
multicol-nested-033.html
(live test)
(source)
nested-as-balanced-legend.html
(live test)
(source)
nested-as-nested-balanced-legend.html
(live test)
(source)
nested-floated-multicol-with-tall-margin.html
(live test)
(source)
nested-multicol-and-float-with-tall-padding-before-float.html
(live test)
(source)
nested-multicol-and-float-with-tall-padding.html
(live test)
(source)
nested-multicol-fieldset-tall-trailing-border-freeze.html
(live test)
(source)
nested-multicol-fieldset-tall-trailing-padding.html
(live test)
(source)
nested-multicol-in-svg-foreignobject.html
(live test)
(source)
nested-multicol-nested-flex.html
(live test)
(source)
nested-multicol-with-float-between.html
(live test)
(source)
nested-oof-multicol-with-monolithic-child.html
(live test)
(source)
nested-oof-multicol-with-oof-needing-additional-columns.html
(live test)
(source)
nested-oof-multicol-with-padding.html
(live test)
(source)
nested-with-fragmented-oof-negative-top-offset.html
(live test)
(source)
nested-with-multicol-table-caption.html
(live test)
(source)
multicol-table-caption-parallel-flow-after-spanner-in-inline.html
(live test)
(source)
nested-with-multicol-table-cell.html
(live test)
(source)
nested-with-oof-inside-fixed-width.html
(live test)
(source)
nested-with-percentage-size-and-oof.html
(live test)
(source)
nested-with-tall-padding-and-oof.html
(live test)
(source)
nested-with-tall-padding.html
(live test)
(source)
oof-in-nested-line-float.html
(live test)
(source)
oof-nested-multicol-inside-oof.html
(live test)
(source)
relayout-nested-with-oof.html
(live test)
(source)
repeated-section-in-nested-table-nested-multicol.html
(live test)
(source)
repeated-table-footer-in-caption-nested-multicol.html
(live test)
(source)
nested-balanced-monolithic-multicol-crash.html
(live test)
(source)
nested-balanced-very-tall-content-crash.html
(live test)
(source)
nested-floated-shape-outside-multicol-with-monolithic-child-crash.html
(live test)
(source)
nested-with-overflowing-padding-crash.html
(live test)
(source)
triply-nested-with-fixedpos-in-abspos-crash.html
(live test)
(source)
fixed-in-nested-multicol-with-transform-container.html
(live test)
(source)
fixed-in-nested-multicol-with-viewport-container.html
(live test)
(source)
fixed-in-nested-multicol.html
(live test)
(source)
nested-after-float-clearance.html
(live test)
(source)
nested-at-outer-boundary-as-fieldset.html
(live test)
(source)
nested-at-outer-boundary-as-float.html
(live test)
(source)
nested-at-outer-boundary-as-legend.html
(live test)
(source)
nested-floated-multicol-with-monolithic-child.html
(live test)
(source)
nested-oofs-in-relative-multicol.html
(live test)
(source)
nested-past-fragmentation-line.html
(live test)
(source)
nested-with-too-tall-line.html
(live test)
(source)
oof-nested-in-single-column.html
(live test)
(source)
nested-non-auto-inline-size-offset-top.html
(live test)
(source)
fixedpos-static-pos-with-viewport-cb-001.html
(live test)
(source)
fixedpos-static-pos-with-viewport-cb-002.html
(live test)
(source)
fixedpos-static-pos-with-viewport-cb-003.html
(live test)
(source)
multicol-height-block-child-001.xht
(live test)
(source)
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 containers with column heights larger than the viewport may pose accessibility issues.
See
Accessibility Considerations
for more details.
4.
The number and size of columns
Finding the number and size of columns is fundamental when laying out multi-column content.
These properties are used to set the number and size of columns:
column-count
column-width
column-height
A fourth property,
columns
, is a shorthand property which sets all of
column-width
column-height
, and
column-count
Other factors, such as explicit column breaks, content, column wrapping,
and size constraints, may influence the actual number and size of columns.
4.1.
The Inline Size of Columns: the
column-width
property
Name:
column-width
Value:
auto
Initial:
auto
Applies to:
block containers
except
table wrapper boxes
Inherited:
no
Percentages:
N/A
Computed value:
the keyword
auto
or an absolute length
Canonical order:
per grammar
Animation type:
by computed value type
This property describes the width of columns in multicol containers.
auto
means that the column width will be determined by other properties
(e.g.,
column-count
, if it has a non-auto value).
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).
Negative values are not allowed.
Used values will be clamped to a minimum of
1px
Tests
zero-column-width-computed-style.html
(live test)
(source)
zero-column-width-layout.html
(live test)
(source)
Tests
multicol-basic-003.html
(live test)
(source)
multicol-basic-008.xht
(live test)
(source)
multicol-reduce-000.xht
(live test)
(source)
multicol-width-001.xht
(live test)
(source)
multicol-width-002.xht
(live test)
(source)
multicol-width-003.xht
(live test)
(source)
multicol-width-005.html
(live test)
(source)
multicol-width-ch-001.html
(live test)
(source)
multicol-width-negative-001.xht
(live test)
(source)
multicol-width-invalid-001.xht
(live test)
(source)
multicol-width-large-001.xht
(live test)
(source)
multicol-width-large-002.xht
(live test)
(source)
multicol-inherit-003.xht
(live test)
(source)
column-width-computed.html
(live test)
(source)
column-width-invalid.html
(live test)
(source)
column-width-valid.html
(live test)
(source)
multicol-width-small-001.xht
(live test)
(source)
For example, consider this style sheet:
div
width
100
px
column-width
45
px
column-gap
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
Also, consider this style sheet:
div
width
40
px
column-width
45
px
column-gap
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 container (assuming horizontal text)
must also be specified.
4.2.
The Block Size of Columns: the
column-height
property
Name:
column-height
Value:
auto
Initial:
auto
Applies to:
block containers
except
table wrapper boxes
Inherited:
no
Percentages:
N/A
Computed value:
the keyword
auto
or an absolute length
Canonical order:
per grammar
Animation type:
by computed value type
This property describes the height of columns in multicol containers.
auto
means that the column height will be determined by the amount of content
and other properties.
describes the desired column height.
Negative values are not allowed.
Tests
column-height-001.html
(live test)
(source)
column-height-002.html
(live test)
(source)
column-height-003.html
(live test)
(source)
column-height-004.html
(live test)
(source)
column-height-005.html
(live test)
(source)
column-height-006.html
(live test)
(source)
column-height-007.html
(live test)
(source)
column-height-008.html
(live test)
(source)
column-height-009.html
(live test)
(source)
column-height-010.html
(live test)
(source)
column-height-011.html
(live test)
(source)
column-height-012.html
(live test)
(source)
column-height-013.html
(live test)
(source)
column-height-014.html
(live test)
(source)
column-height-015.html
(live test)
(source)
column-height-016.html
(live test)
(source)
column-height-017.html
(live test)
(source)
column-height-018.html
(live test)
(source)
column-height-019.html
(live test)
(source)
column-height-020.html
(live test)
(source)
column-height-021.html
(live test)
(source)
column-height-022.html
(live test)
(source)
column-height-023.html
(live test)
(source)
column-height-024.html
(live test)
(source)
column-height-025.html
(live test)
(source)
column-height-026.html
(live test)
(source)
column-height-027.html
(live test)
(source)
column-height-028.html
(live test)
(source)
column-height-029.html
(live test)
(source)
column-height-030.html
(live test)
(source)
zero-column-height.html
(live test)
(source)
If you set
column-height
and
height
on a multicol container,
you may end up with some additional space.
The properties defined in the
[CSS-ALIGN]
specification detail how to deal with it.
When
column-height
is not 'column-height/auto' the size in the block direction is not flexible.
If there is not enough content to fill a row of columns at the set size,
empty space is left.
If a spanner is introduced that is taller than the set size,
the row geometry will be maintained, and the spanner will overflow into the next row, crossing any
row-gap
4.3.
The Number of Columns: the
column-count
property
Name:
column-count
Value:
auto
Initial:
auto
Applies to:
block containers
except
table wrapper boxes
Inherited:
no
Percentages:
N/A
Computed value:
specified value
Canonical order:
per grammar
Animation type:
by computed value
This property describes the number of columns of a
multicol container
auto
means that the number of columns will be determined by other properties
(e.g.,
column-width
, if it has a non-auto value).
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.
Tests
multicol-count-001.xht
(live test)
(source)
multicol-count-002.xht
(live test)
(source)
multicol-basic-006.xht
(live test)
(source)
multicol-width-count-001.xht
(live test)
(source)
multicol-width-count-002.xht
(live test)
(source)
multicol-columns-toolong-001.xht
(live test)
(source)
multicol-count-negative-001.xht
(live test)
(source)
multicol-count-negative-002.xht
(live test)
(source)
multicol-count-non-integer-001.xht
(live test)
(source)
multicol-count-non-integer-002.xht
(live test)
(source)
multicol-count-non-integer-003.xht
(live test)
(source)
multicol-inherit-001.xht
(live test)
(source)
multicol-inherit-002.xht
(live test)
(source)
column-count-invalid.html
(live test)
(source)
column-count-valid.html
(live test)
(source)
column-count-computed.html
(live test)
(source)
column-count-interpolation.html
(live test)
(source)
large-actual-column-count.html
(live test)
(source)
with-custom-layout-on-same-element.https.html
(live test)
(source)
Example:
body
column-count
4.4.
The overflow direction: the
column-wrap
property
Name:
column-wrap
Value:
auto
nowrap
wrap
Initial:
auto
Applies to:
multicol containers
Inherited:
no
Percentages:
n/a
Computed value:
specified keyword
Canonical order:
per grammar
Animation type:
discrete
The column-wrap property controls the behavior of overflow columns.
Overflow columns occur when there is more content than will fit in a single row of columns at the specified
column-height
or inside a height defined by the multicol container.
auto
If
column-height
is not 'column-height/auto' behaves as the value 'column-wrap/wrap' otherwise acts as 'column-wrap/nowrap'.
nowrap
Overflow columns are created in the inline direction.
wrap
Overflow columns create a new multicol row in the block direction.
Example:
body
column-count
column-wrap
nowrap
column-height
10
em
This CSS creates a set of three columns.
If there is more content than would fit in the 10em height of these columns,
new columns are created in the inline direction
even if there is room in the multicol container.
Example:
body
column-count
column-wrap
wrap
column-height
10
em
This CSS creates a set of three columns.
If there is more content than would fit in the 10em height of these columns,
rather than overflowing in the inline direction,
a new row of columns is created in the block direction, again at a max column-height of 10em.
New rows repeat until all content is displayed.
Tests
column-wrap-no-constraints-001.html
(live test)
(source)
column-wrap-no-constraints-002.html
(live test)
(source)
Note:
The reading flow of a 2-dimensional multiple-column layout follows along the row,
reading each column in row 1 in turn, then moving onto row 2, and so on.
Authors should ensure that it’s clear to a reader how the content flows,
particularly in situations where multiple rows are displayed on screen.
The issue relating to the addition of this property is still open due to debate as to whether it’s required.
[Issue #11754]
What happens if you set a height on the multicol container, 'column-wrap: wrap' but no
column-height
Options are 1: The
column-wrap
property is ignored. 2: 'column-height: auto' resolves to the available space
in the multicol container and new rows of that size are created for the overflow,
thus honoring the 'column-wrap/wrap' value.
[Issue #11754]
4.5.
The
column-width
column-count
, and
column-height
Shorthand: The
columns
Property
Name:
columns
Value:
<'column-width'>
||
<'column-count'>
] [ /
<'column-height'>
Initial:
see individual properties
Applies to:
see individual properties
Inherited:
see individual properties
Percentages:
see individual properties
Computed value:
see individual properties
Animation type:
see individual properties
Canonical order:
per grammar
This is a shorthand property for setting
column-width
column-count
and
column-height
Omitted values are set to their initial values.
This property also resets the
column-wrap
property to its initial value.
Here are some valid declarations using the
columns
property:
columns
12
em
/* column-width: 12em; column-count: auto */
columns: auto
12
em
/* column-width: 12em; column-count: auto */
columns:
/* column-width: auto; column-count: 2 */
columns:
auto
/* column-width: auto; column-count: 2 */
columns: auto
/* column-width: auto; column-count: auto */
columns: auto auto
/* column-width: auto; column-count: auto */
columns:
12
em
14
em
/* column-width: 12em; column-height: 14em; */
Tests
column-wrap-reset-interpolation.html
(live test)
(source)
columns-interpolation.html
(live test)
(source)
columns-shorthand-reset-wrap.html
(live test)
(source)
multicol-columns-001.xht
(live test)
(source)
multicol-columns-002.xht
(live test)
(source)
multicol-columns-003.xht
(live test)
(source)
multicol-columns-004.xht
(live test)
(source)
multicol-columns-005.xht
(live test)
(source)
multicol-columns-006.xht
(live test)
(source)
multicol-columns-007.xht
(live test)
(source)
multicol-columns-invalid-001.xht
(live test)
(source)
multicol-columns-invalid-002.xht
(live test)
(source)
multicol-basic-001.html
(live test)
(source)
multicol-basic-003.html
(live test)
(source)
multicol-basic-005.xht
(live test)
(source)
multicol-basic-007.xht
(live test)
(source)
columns-computed.html
(live test)
(source)
columns-invalid.html
(live test)
(source)
columns-valid.html
(live test)
(source)
4.6.
The Pseudo-algorithm
The pseudo-algorithm below determines the used values for
column-count
(N) and
column-width
(W). There is one other variable
in the pseudo-algorithm: U is the used width of the multi-column container.
Note:
The used width U of the multi-column container 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 Box Sizing Module
[CSS3-SIZING]
) is expected to define this.
Tests
intrinsic-size-001.html
(live test)
(source)
intrinsic-size-002.html
(live test)
(source)
intrinsic-size-003.html
(live test)
(source)
intrinsic-size-004.html
(live test)
(source)
intrinsic-size-005.html
(live test)
(source)
as-column-flex-item.html
(live test)
(source)
intrinsic-width-change-column-count.html
(live test)
(source)
The
floor(X)
function returns the largest integer Y ≤ X.
(01) if ((column-width = auto) and (column-count = auto) and (column-height = auto)) then
(02) exit; /* not a multicol container */
(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 columns,
the UA must floor the column size to a UA-specified value to avoid division by zero.
It is suggested that this floor be 1px or less.
In fragmented contexts such as in
paged media
user agents may perform this calculation on a per-fragment 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.
Tests
column-count-used-001.html
(live test)
(source)
In this example, the actual column-count is higher than the used column-count
due to explicit column breaks:
div
width
40
em
columns
20
em
column-gap
break-after
column
div
one
two
three
div
The computed column-count is auto, the used column-count is 2 and the actual column-count is 3.
The actual column-count may be lower than the used column-count.
Consider this example:
div
width
80
em
height
10
em
columns
20
em
column-gap
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.
4.7.
Stacking Context
All column boxes in a multi-column container 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.
Tests
multicol-rule-stacking-001.xht
(live test)
(source)
4.8.
Styling Columns: the
::column
pseudo-element
The
::column
pseudo-element
represents the individual columns
in a
multi-column container
It only exists on
multi-column containers
Tests
column-pseudo-background-color.html
(live test)
(source)
column-pseudo-computed.html
(live test)
(source)
column-pseudo-invalid.html
(live test)
(source)
column-pseudo-valid.html
(live test)
(source)
multi-column container
has as many
::column
pseudo-elements
as it has columns.
They cannot be individually addressed;
any styles applied to a multicol’s
::column
pseudo-elements
apply to all of them on that element.
Each
::column
has the same size and position
as its corresponding column:
the same size as the column’s
available space
in the
inline axis
and the container’s
content box
in the
block axis
(It does not cover the gaps/rules between columns.)
::column
pseudo-elements are treated as children of their
multi-column container
without any contents.
They
do not
wrap the contents of the column,
just fill the same space.
The
::column
pseudo-element accepts only a very limited set of properties:
scroll-margin
scroll-snap-align
, and
scroll-snap-stop
(the scroll snap properties that apply to elements
inside
scroll container
Additionally, a
::column
pseudo-element can have a
::scroll-marker
pseudo-element of its own,
as
::column::scroll-marker
(Other pseudo-elements do not exist on
::column
.)
Such
::scroll-marker
pseudo-elements
inherit from the
::column
pseudo-element’s
originating element
rather than the
::column
itself.
Note:
This list of properties and pseudo-elements that work on
::column
will likely be expanded in the future,
as we develop more features
that could usefully care about the
position
of a column
without caring about the
contents
5.
Column Gaps and Rules
Column gaps and rules are placed between columns in the same
multicol container
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 container
).
Tests
column-rule-001.html
(live test)
(source)
column-rule-002.html
(live test)
(source)
multicol-height-001.xht
(live test)
(source)
multicol-nested-column-rule-001.xht
(live test)
(source)
multicol-nested-column-rule-002.html
(live test)
(source)
multicol-nested-column-rule-003.html
(live test)
(source)
multicol-rule-nested-balancing-001.html
(live test)
(source)
multicol-rule-nested-balancing-002.html
(live test)
(source)
multicol-rule-nested-balancing-003.html
(live test)
(source)
multicol-rule-nested-balancing-004.html
(live test)
(source)
Basic column rule tests
multicol-rule-003.xht
(live test)
(source)
multicol-rule-004.xht
(live test)
(source)
multicol-rule-fraction-002.xht
(live test)
(source)
If a column rule is wider than its gap, adjacent boxes overlap.
multicol-rule-001.xht
(live test)
(source)
multicol-rule-large-001.xht
(live test)
(source)
multicol-rule-large-002.xht (visual test)
(source)
Column rules are only drawn between two columns that have content.
multicol-count-computed-003.xht
(live test)
(source)
multicol-count-computed-005.xht
(live test)
(source)
broken-column-rule-1.html
(live test)
(source)
Tests for behavior of backgrounds and column rules.
multicol-breaking-000.html
(live test)
(source)
multicol-breaking-001.html
(live test)
(source)
multicol-breaking-002.html
(live test)
(source)
multicol-breaking-003.html
(live test)
(source)
multicol-breaking-004.html
(live test)
(source)
multicol-breaking-005.html
(live test)
(source)
multicol-breaking-006.html
(live test)
(source)
multicol-breaking-nobackground-000.html
(live test)
(source)
multicol-breaking-nobackground-001.html
(live test)
(source)
multicol-breaking-nobackground-002.html
(live test)
(source)
multicol-breaking-nobackground-003.html
(live test)
(source)
multicol-breaking-nobackground-004.html
(live test)
(source)
multicol-breaking-nobackground-005.html
(live test)
(source)
5.1.
Gutters Between Columns: the
column-gap
property
The
column-gap
property is defined in
[CSS3-ALIGN]
In a
multi-column formatting context
the used value of
normal
for the
column-gap
property is
1em
This ensures columns are readable when the initial values are used.
If there is a column rule between columns,
it will appear in the middle of the gap.
Tests
multicol-gap-fraction-001.xht
(live test)
(source)
multicol-gap-fraction-002.html
(live test)
(source)
multicol-gap-large-001.xht
(live test)
(source)
multicol-gap-large-002.xht
(live test)
(source)
multicol-gap-negative-001.xht
(live test)
(source)
multicol-gap-000.xht
(live test)
(source)
multicol-gap-002.xht
(live test)
(source)
multicol-gap-percentage-001.html
(live test)
(source)
multicol-gap-001.xht
(live test)
(source)
multicol-gap-003.xht
(live test)
(source)
Tests that the gap is animatable.
multicol-gap-animation-001.html
(live test)
(source)
multicol-gap-animation-002.html
(live test)
(source)
multicol-gap-animation-003.html
(live test)
(source)
5.2.
Gutters Between Rows: the
row-gap
property
The
row-gap
property is defined in
[CSS3-ALIGN]
In a
multi-column formatting context
the used value of
normal
for the
row-gap
property is
1em
If there is a rule between rows,
it will appear in the middle of the gap.
5.3.
The Color, Width, and Style of Column Rules: the
gap decoration properties
The gap decoration properties of
column-rule
and
row-rule
along with their longhands
column-rule-color
row-rule-color
column-rule-style
row-rule-style
column-rule-width
row-rule-width
are defined in
[CSS-GAPS]
Tests
Tests for column-rule-color in multicol
multicol-rule-color-001.xht
(live test)
(source)
multicol-rule-color-inherit-001.xht
(live test)
(source)
multicol-rule-color-inherit-002.xht
(live test)
(source)
column-rule-color-computed.html
(live test)
(source)
column-rule-color-valid.html
(live test)
(source)
column-rule-color-invalid.html
(live test)
(source)
column-rule-color-interpolation.html
(live test)
(source)
Tests for column-rule-style in multicol.
column-rule-style-computed.html
(live test)
(source)
column-rule-style-valid.html
(live test)
(source)
column-rule-style-invalid.html
(live test)
(source)
Tests for column-rule-style in multicol.
multicol-shorthand-001.xht
(live test)
(source)
multicol-rule-shorthand-001.xht
(live test)
(source)
multicol-rule-shorthand-2.xht
(live test)
(source)
multicol-rule-000.xht
(live test)
(source)
multicol-rule-002.xht
(live test)
(source)
multicol-rule-dashed-000.xht
(live test)
(source)
multicol-rule-dotted-000.xht
(live test)
(source)
multicol-rule-double-000.xht
(live test)
(source)
multicol-rule-outset-000.xht
(live test)
(source)
multicol-rule-none-000.xht
(live test)
(source)
multicol-rule-hidden-000.xht
(live test)
(source)
multicol-rule-inset-000.xht
(live test)
(source)
multicol-rule-groove-000.xht
(live test)
(source)
multicol-rule-ridge-000.xht
(live test)
(source)
multicol-rule-solid-000.xht
(live test)
(source)
column-rule-computed.html
(live test)
(source)
column-rule-invalid.html
(live test)
(source)
column-rule-valid.html
(live test)
(source)
column-rule-shorthand.html
(live test)
(source)
equal-gap-and-rule.html
(live test)
(source)
multicol-rule-samelength-001.xht
(live test)
(source)
fixed-size-child-with-overflow.html
(live test)
(source)
6.
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
6.1.
Controlling Fragmentation: the
break-before
break-after
break-inside
properties
break-before
break-after
, and
break-inside
are defined in
[CSS3-BREAK]
Tests
multicol-break-000.xht
(live test)
(source)
multicol-break-001.xht
(live test)
(source)
multicol-br-inside-avoidcolumn-001.xht
(live test)
(source)
moz-multicol3-column-balancing-break-inside-avoid-1.html (manual test)
(source)
7.
Spanning columns
The
column-span
property makes it possible for an element to span across several columns.
This specification adds
to the values available in the previous level.
7.1.
column-span
Name:
column-span
Value:
none
all
auto
Initial:
none
Applies to:
in-flow
block-level elements
Inherited:
no
Percentages:
N/A
Computed value:
specified value
Canonical order:
per grammar
Animation type:
discrete
Tests
column-span-invalid.html
(live test)
(source)
This property describes how many columns an element spans across. Values are:
none
The element does not span multiple columns.
Tests
multicol-span-none-001.xht
(live test)
(source)
all
The element forces a column break and is taken
out of flow
to span across all columns of the current multicol row
in the same
block formatting context
Content in the normal flow that appears before the element
is automatically balanced across all columns
in the immediately preceding
multi-column line
before the element appears,
and any subsequent content flows into a new
multi-column line
after the element.
The element establishes an
independent formatting context
Note:
Whether the element establishes a new
formatting context
does not depend on whether the element is a descendant 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.
Tests
multicol-span-000.xht
(live test)
(source)
multicol-span-all-001.xht
(live test)
(source)
multicol-span-all-003.xht
(live test)
(source)
multicol-span-all-block-sibling-003.xht
(live test)
(source)
multicol-span-all-margin-001.xht
(live test)
(source)
multicol-span-all-margin-002.xht
(live test)
(source)
multicol-span-all-margin-003.html
(live test)
(source)
multicol-span-all-margin-bottom-001.xht
(live test)
(source)
multicol-span-all-margin-nested-001.xht
(live test)
(source)
multicol-span-all-margin-nested-002.xht
(live test)
(source)
multicol-span-all-margin-nested-firstchild-001.xht
(live test)
(source)
multicol-span-float-001.xht
(live test)
(source)
multicol-span-float-002.html
(live test)
(source)
multicol-span-float-003.html
(live test)
(source)
multicol-span-float-004.html
(live test)
(source)
inline-block-and-column-span-all.html
(live test)
(source)
multicol-span-all-dynamic-remove-001.html
(live test)
(source)
multicol-span-all-dynamic-add-001.html
(live test)
(source)
multicol-span-all-dynamic-remove-002.html
(live test)
(source)
multicol-span-all-dynamic-add-002.html
(live test)
(source)
multicol-span-all-dynamic-remove-003.html
(live test)
(source)
multicol-span-all-dynamic-add-003.html
(live test)
(source)
multicol-span-all-dynamic-remove-004.html
(live test)
(source)
multicol-span-all-dynamic-add-004.html
(live test)
(source)
multicol-span-all-dynamic-add-005.html
(live test)
(source)
multicol-span-all-dynamic-remove-005.html
(live test)
(source)
multicol-span-all-dynamic-remove-006.html
(live test)
(source)
multicol-span-all-dynamic-add-006.html
(live test)
(source)
multicol-span-all-dynamic-remove-007.html
(live test)
(source)
multicol-span-all-dynamic-add-007.html
(live test)
(source)
multicol-span-all-dynamic-add-008.html
(live test)
(source)
multicol-span-all-dynamic-add-009.html
(live test)
(source)
multicol-span-all-dynamic-add-010.html
(live test)
(source)
multicol-span-all-dynamic-add-011.html
(live test)
(source)
multicol-span-all-dynamic-add-012.html
(live test)
(source)
multicol-span-all-dynamic-add-013.html
(live test)
(source)
multicol-span-all-dynamic-add-014.html
(live test)
(source)
multicol-span-all-children-height-001.html
(live test)
(source)
multicol-span-all-children-height-002.html
(live test)
(source)
multicol-span-all-children-height-003.html
(live test)
(source)
multicol-span-all-children-height-004a.html
(live test)
(source)
multicol-span-all-children-height-004b.html
(live test)
(source)
multicol-span-all-children-height-005.html
(live test)
(source)
multicol-span-all-children-height-006.html
(live test)
(source)
multicol-span-all-children-height-007.html
(live test)
(source)
multicol-span-all-children-height-008.html
(live test)
(source)
multicol-span-all-children-height-009.html
(live test)
(source)
multicol-span-all-children-height-010.html
(live test)
(source)
multicol-span-all-children-height-011.html
(live test)
(source)
multicol-span-all-children-height-012.html
(live test)
(source)
multicol-span-all-children-height-013.html
(live test)
(source)
multicol-span-all-004.html
(live test)
(source)
multicol-span-all-005.html
(live test)
(source)
multicol-span-all-006.html
(live test)
(source)
multicol-span-all-007.html
(live test)
(source)
multicol-span-all-008.html
(live test)
(source)
multicol-span-all-009.html
(live test)
(source)
multicol-span-all-010.html
(live test)
(source)
multicol-span-all-011.html
(live test)
(source)
multicol-span-all-012.html
(live test)
(source)
multicol-span-all-013.html
(live test)
(source)
multicol-span-all-014.html
(live test)
(source)
multicol-span-all-015.html
(live test)
(source)
multicol-span-all-016.html
(live test)
(source)
multicol-span-all-017.html
(live test)
(source)
multicol-span-all-018.html
(live test)
(source)
multicol-span-all-019.html
(live test)
(source)
multicol-span-all-020.html
(live test)
(source)
multicol-span-all-rule-001.html
(live test)
(source)
multicol-span-all-rule-002.html
(live test)
(source)
multicol-span-all-button-001.html
(live test)
(source)
multicol-span-all-button-002.html
(live test)
(source)
multicol-span-all-button-003.html
(live test)
(source)
multicol-span-all-fieldset-001.html
(live test)
(source)
multicol-span-all-fieldset-002.html
(live test)
(source)
multicol-span-all-fieldset-003.html
(live test)
(source)
multicol-span-all-restyle-001.html
(live test)
(source)
multicol-span-all-restyle-002.html
(live test)
(source)
multicol-span-all-restyle-003.html
(live test)
(source)
multicol-span-all-restyle-004.html
(live test)
(source)
multicol-span-all-list-item-001.html
(live test)
(source)
multicol-span-all-list-item-002.html
(live test)
(source)
multicol-span-auto-size-in-vertical-writing-mode-001.html
(live test)
(source)
multicol-span-auto-size-in-vertical-writing-mode-002.html
(live test)
(source)
float-with-line-after-spanner.html
(live test)
(source)
parallel-flow-after-spanner-001.html
(live test)
(source)
parallel-flow-after-spanner-002.html
(live test)
(source)
margin-and-break-before-child-spanner.html
(live test)
(source)
multicol-width-004.html
(live test)
(source)
The element spans the specified number of columns.
Values must be greater than 0.
If the specified integer value is equal to,
or larger than the number of columns in the multicol element,
the number of columns spanned will be the same as if
column-span: all
had been specified.
This definition is insufficient.
Does
column-span: 1
count as
column-span: none
or does it create a spanner (which is a BFC)?
Which columns does it span?
How does that affect height calculations, and interact with column-fill
auto
The number of columns spanned by the element
depends on its
min-content
outer size
in the inline direction of the
multi-column container
If it is smaller than the used value of
column-width
this is the same as if
column-span: none
had been specified.
Otherwise, the number of columns spanned is the smallest positive integer
for which
column-width
+ (
- 1) ×
column-gap
is larger than the
min-content
outer size
If this would be larger than the number of columns,
the number of columns spanned will be the same as if
column-span: all
had been specified.
If
column-span: 1
does not do the same as
column-span: none
should this behave as
column-span: 1
or as
column-span: none
when the element is small enough?
An element that spans more than one column is called a
multi-column spanning element
and the box it creates is called a
multi-column spanner
The
containing block
of the
spanner
is the
multicol container
itself.
Consequently, in cases where the spanner itself does not establish
containing block
for
absolutely positioned boxes
inside the spanner,
their
containing block chain
skips directly to the
multicol container
(skipping any ancestors between the
spanner
and the
multicol container
).
Although the spanner is taken
out-of-flow
this does not affect the
painting order
[CSS21]
of the spanning element.
In this example, an
h2
element has been added to the sample document after the sixth sentence
(i.e., after the words "the leg of a").
This styling applies:
h2
column-span
all
background
silver
By setting
column-span
to
all
all content that appears before the
h2
element
is shown above the
h2
element.
The h2 element is set to column-span: all
Note that because the spanner splits the
multi-column line
it also interrupts any
column rules
(which are only drawn between
columns
in a
multi-column line
).
A spanning element may be lower than the first level of descendants
as long as they are part of the same
formatting context
and there is nothing between the spanning element and
multicol container
that establishes a containing block for fixed position descendants.
In this example, the element with
column-span: all
is inside an element with
transform: rotate(90deg)
The transform establishes a containing block for fixed position descendents,
therefore a spanner will not be created.
article
section
div
class
"spanner"
Attempted spanner
div
section
article
article
columns
section
transform
rotate
90
deg
);
.spanner
column-span
all
background
silver
Tests
fixed-in-multicol-with-transform-container.html
(live test)
(source)
change-transform-in-nested.html
(live test)
(source)
change-transform-in-second-column.html
(live test)
(source)
change-transform.html
(live test)
(source)
If the fragment before the spanner is empty, nothing special happens;
the top margin/border/padding is above the spanning element, as an empty
fragment
In this example the
multicol container
is the
article
element.
Inside this parent is a paragraph and then a section element.
The section contains an
h2
heading set to
all
this spans all three columns while the containing section remains inside the column boxes.
The
h2
is the first child of the section.
This means that the margin,
border (shown in red in the diagram)
and padding on this section appear before the spanning
h2
as an empty fragment.
article
...
section
h2
An h2 element
h2
...
section
article
section
border
px
solid red
margin-top
65
px
padding-top
20
px
h2
column-span
all
background
silver
The
h2
element is set to
column-span: all
the section has a red border and top padding and margin
Tests
spanner-fragmentation-000.html
(live test)
(source)
spanner-fragmentation-001.html
(live test)
(source)
spanner-fragmentation-002.html
(live test)
(source)
spanner-fragmentation-003.html
(live test)
(source)
spanner-fragmentation-004.html
(live test)
(source)
spanner-fragmentation-005.html
(live test)
(source)
spanner-fragmentation-006.html
(live test)
(source)
spanner-fragmentation-007.html
(live test)
(source)
spanner-fragmentation-008.html
(live test)
(source)
spanner-fragmentation-009.html
(live test)
(source)
spanner-fragmentation-010.html
(live test)
(source)
spanner-fragmentation-011.html
(live test)
(source)
spanner-fragmentation-012.html
(live test)
(source)
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.
In this example, the
h2
element appears later in the content,
and the height of the multicol container is constrained.
Therefore, the
h2
element appears in the overflow
and there is not room to make the element spanning.
As a result, the element appears as if
column-span: none
was specified.
The h2 element is in an overflow column and appears as if column-span none is specified
This example is similar to the previous example,
except that the H2 element appears naturally in the last column.
Still, there is not enough room to make the element spanning.
The h2 element is in the final column and appears as if column-span none is specified
Tests
multicol-span-all-002.xht
(live test)
(source)
In fragmented contexts spanning elements are honored in all fragments.
In this example, we are in
paged media
and the first three paragraphs have column breaks after them.
A spanning
H2
element appears after the fourth paragraph.
This would appear on the first page
This would appear on the second page
Spanners are block-level boxes
therefore the margins of two adjacent spanners will collapse with each other.
The margins of two spanners separated only by an absolutely positioned item will collapse with each other,
as absolutely positioned items do not create column boxes.
As column boxes establish a new
block formatting context
margins on elements inside a column box will not collapse with the margin of a spanner.
Tests
non-adjacent-spanners-000.html
(live test)
(source)
non-adjacent-spanners-001.html
(live test)
(source)
Spanners establish new
formatting contexts
, but their margins can be changed by their surroundings.
In this example, two spanners naturally end up at the top of a page.
The top margin of the first spanner is truncated due to adjoining an unforced break.
The margins between the two spanners collapse with each other.
However, the bottom margin of the second spanner does not collapse with the top margin of the subsequent element.
h2
margin
16
px
column-span
all
background
silver
margin-top
16
px
Margins collapse between two spanning elements, but not the bottom margin of a spanner and top margin of next element.
Tests
Additional tests relating to spanners.
abspos-in-multicol-with-spanner-crash.html
(live test)
(source)
body-becomes-spanner-html-becomes-vertical-rl.html
(live test)
(source)
fit-content-with-spanner-and-auto-scrollbar-sibling.html
(live test)
(source)
float-becomes-non-float-spanner-surprises-inside.html
(live test)
(source)
float-becomes-spanner.html
(live test)
(source)
float-becomes-spanner-remove-child.html
(live test)
(source)
float-cannot-be-spanner.html
(live test)
(source)
multicol-floats-after-column-span-crash.html
(live test)
(source)
negative-margin-on-column-spanner.html
(live test)
(source)
nested-spanner-with-negative-margin.html
(live test)
(source)
oof-becomes-spanner.html
(live test)
(source)
oof-in-additional-column-before-spanner.html
(live test)
(source)
oof-in-spanner-in-relpos-in-multicol-in-relpos-multicol-001.html
(live test)
(source)
oof-in-spanner-in-relpos-in-multicol-in-relpos-multicol-002.html
(live test)
(source)
relpos-spanner-with-spanner-child-becomes-regular.html
(live test)
(source)
remove-spanner-after-spanner-in-inline-before-inline.html
(live test)
(source)
remove-spanner-in-table-caption-nested-multicol.html
(live test)
(source)
remove-transform-descendant-becomes-spanner-remove-spanner-child.html
(live test)
(source)
restricted-height-bottom-border-overflow-and-spanner.html
(live test)
(source)
scrollable-spanner-in-nested.html
(live test)
(source)
spanner-after-parallel-flow.html
(live test)
(source)
spanner-in-inline-after-very-tall-content-001.html
(live test)
(source)
spanner-in-inline-after-very-tall-content-002.html
(live test)
(source)
spanner-in-overflowed-container-before-float.html
(live test)
(source)
spanner-in-relpos-in-abspos-multicol-in-multicol.html
(live test)
(source)
nested-with-tall-padding-and-spanner-and-content.html
(live test)
(source)
specified-height-with-just-spanner-and-oof.html
(live test)
(source)
trailing-parent-padding-between-spanners.html
(live test)
(source)
table-caption-change-descendant-display-type.html
(live test)
(source)
table-caption-inline-block-remove-child.html
(live test)
(source)
remove-block-beside-spanner-in-inline-crash.html
(live test)
(source)
remove-inline-with-block-beside-spanners-crash.html
(live test)
(source)
remove-spanner-beside-spanner-in-inline-crash.html
(live test)
(source)
remove-transform-descendant-becomes-spanner.html
(live test)
(source)
spanning-legend-000-crash.html
(live test)
(source)
spanning-legend-001-crash.html
(live test)
(source)
toggle-spanner-float-crash.html
(live test)
(source)
abspos-after-spanner-static-pos.html
(live test)
(source)
abspos-after-spanner.html
(live test)
(source)
abspos-containing-block-outside-spanner.html
(live test)
(source)
change-transform-in-spanner.html
(live test)
(source)
nested-with-padding-and-spanner.html
(live test)
(source)
orthogonal-writing-mode-spanner.html
(live test)
(source)
remove-inline-with-block-beside-spanners.html
(live test)
(source)
replaced-content-spanner-auto-width.html
(live test)
(source)
spanner-in-child-after-parallel-flow-001.html
(live test)
(source)
spanner-in-child-after-parallel-flow-002.html
(live test)
(source)
spanner-in-child-after-parallel-flow-003.html
(live test)
(source)
spanner-in-child-after-parallel-flow-004.html
(live test)
(source)
spanner-in-opacity.html
(live test)
(source)
going-out-of-flow-after-spanner.html
(live test)
(source)
inline-with-spanner-in-overflowed-container-before-multicol-float.html
(live test)
(source)
spanner-in-overflowed-clipped-container.html
(live test)
(source)
spanner-in-overflowed-container-before-inline-content.html
(live test)
(source)
spanner-inside-inline-in-overflowed-container.html
(live test)
(source)
column-span-valid.html
(live test)
(source)
column-span-computed.html
(live test)
(source)
getclientrects-000.html
(live test)
(source)
getclientrects-001.html
(live test)
(source)
8.
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.
8.1.
Column Balancing: the
column-fill
property
Name:
column-fill
Value:
auto
balance
balance-all
Initial:
balance
Applies to:
multicol containers
Inherited:
no
Percentages:
N/A
Computed value:
specified keyword
Canonical order:
per grammar
Animation type:
discrete
This property specifies whether content
in a
multi-column line
that does
not
immediately precede a
spanner
is balanced across columns or not.
Tests
always-balancing-before-column-span.html
(live test)
(source)
no-balancing-after-column-span.html
(live test)
(source)
The values are:
balance
Balance content equally between columns, as far as possible.
In fragmented contexts, only the last fragment is balanced.
Tests
multicol-fill-000.xht
(live test)
(source)
multicol-fill-001.xht
(live test)
(source)
column-fill-invalid.html
(live test)
(source)
column-fill-valid.html
(live test)
(source)
column-fill-computed.html
(live test)
(source)
column-fill-balance-orthog-block-001.html
(live test)
(source)
column-balancing-paged-001-print.html
(live test)
(source)
multicol-fill-balance-001.xht
(live test)
(source)
multicol-fill-balance-002.html
(live test)
(source)
multicol-fill-balance-003.html
(live test)
(source)
multicol-fill-balance-004.html
(live test)
(source)
multicol-fill-balance-005.html
(live test)
(source)
multicol-fill-balance-006.html
(live test)
(source)
multicol-fill-balance-007.html
(live test)
(source)
multicol-fill-balance-008.html
(live test)
(source)
multicol-fill-balance-009.html
(live test)
(source)
multicol-fill-balance-010.html
(live test)
(source)
multicol-fill-balance-011.html
(live test)
(source)
multicol-fill-balance-012.html
(live test)
(source)
multicol-fill-balance-013.html
(live test)
(source)
multicol-fill-balance-014.html
(live test)
(source)
multicol-fill-balance-015.html
(live test)
(source)
multicol-fill-balance-016.html
(live test)
(source)
multicol-fill-balance-018.html
(live test)
(source)
multicol-fill-balance-019.html
(live test)
(source)
multicol-fill-balance-020.html
(live test)
(source)
multicol-fill-balance-021.html
(live test)
(source)
multicol-fill-balance-022.html
(live test)
(source)
multicol-fill-balance-023.html
(live test)
(source)
multicol-fill-balance-024.html
(live test)
(source)
multicol-fill-balance-025.html
(live test)
(source)
multicol-fill-balance-026.html
(live test)
(source)
multicol-fill-balance-027.html
(live test)
(source)
multicol-fill-balance-028.html
(live test)
(source)
multicol-fill-balance-030.html
(live test)
(source)
multicol-fill-balance-031.html
(live test)
(source)
multicol-fill-balance-032.html
(live test)
(source)
multicol-fill-balance-033.html
(live test)
(source)
multicol-fill-balance-034.html
(live test)
(source)
multicol-fill-balance-035.html
(live test)
(source)
multicol-fill-balance-036.html
(live test)
(source)
multicol-fill-balance-037.html
(live test)
(source)
multicol-fill-balance-038.html
(live test)
(source)
multicol-fill-balance-039.html
(live test)
(source)
multicol-fill-balance-nested-000.html
(live test)
(source)
balance-all
Balance content equally between columns, as far as possible.
In fragmented contexts, all fragments are balanced.
auto
fill columns sequentially
Tests
multicol-fill-auto-001.xht
(live test)
(source)
multicol-fill-auto-002.xht
(live test)
(source)
multicol-fill-auto-003.xht
(live test)
(source)
multicol-fill-auto-004.html
(live test)
(source)
multicol-fill-auto-block-children-001.xht
(live test)
(source)
multicol-fill-auto-block-children-002.xht
(live test)
(source)
multicol-fill-auto-block-children-003.html
(live test)
(source)
columnfill-auto-max-height-001.html
(live test)
(source)
columnfill-auto-max-height-002.html
(live test)
(source)
columnfill-auto-max-height-003.html
(live test)
(source)
In continuous contexts, this property does not have any effect when there are overflow columns.
In this example, an article only has one short paragraph which fits on three lines.
The three lines are displayed in three different
columns due to column balancing.
article
width
60
em
height
auto
columns
column-fill
balance
Three lines displayed in three columns due to column balancing.
In this example, column balancing is turned off, and the article has a height:
article
width
60
em
height
em
columns
column-fill
auto
As a result, the first column is filled with all content:
No balancing so the whole text is shown in one paragraph.
In this example, an article has two paragraphs:
first a long one,
then a shorter one.
This code is applied:
article
width
60
em
height
auto
columns
column-fill
balance
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.
Once column height is established, columns are filled sequentially.
article
width
60
em
height
auto
columns
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:
Column height is established by the figure.
Tests
Tests relating to column balancing in combination with out-of-flow elements.
column-balancing-with-span-and-oof-001.html
(live test)
(source)
column-balancing-with-span-and-oof-002.html
(live test)
(source)
forced-break-in-oof-in-column-balancing-nested.html
(live test)
(source)
forced-break-in-oof-in-column-balancing.html
(live test)
(source)
Other tests relating to balancing
balance-extremely-tall-monolithic-content-crash.html
(live test)
(source)
column-balancing-with-overflow-auto-crash.html
(live test)
(source)
balance-break-avoidance-000.html
(live test)
(source)
balance-break-avoidance-001.html
(live test)
(source)
balance-break-avoidance-002.html
(live test)
(source)
balance-grid-container.html
(live test)
(source)
balance-orphans-widows-000.html
(live test)
(source)
balance-with-forced-break.html
(live test)
(source)
balancing-flex-item-trailing-margin-freeze.html
(live test)
(source)
balancing-tall-borders-freeze.html
(live test)
(source)
9.
Overflow
9.1.
Overflow Inside Multicol Containers
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
§ 6 Column Breaks
for column breaks
and
§ 9.2 Pagination and Overflow Outside Multicol Containers
for whether it is clipped to the multi-column container’s content box.
In this example, the image is wider than the column:
Content visibly overflows and is not clipped to the column box.
Tests
multicol-block-no-clip-001.xht
(live test)
(source)
multicol-block-no-clip-002.xht
(live test)
(source)
multicol-clip-001.xht
(live test)
(source)
multicol-clip-002.xht
(live test)
(source)
multicol-clip-scrolled-content-001.html
(live test)
(source)
multicol-overflow-clip-auto-sized.html
(live test)
(source)
multicol-overflow-clip-positioned.html
(live test)
(source)
multicol-overflow-clip.html
(live test)
(source)
relative-child-overflowing-column-gap.html
(live test)
(source)
relative-child-overflowing-container.html
(live test)
(source)
9.2.
Pagination and Overflow Outside Multicol Containers
Content and column rules that extend outside column boxes at
the edges of the multi-column container are clipped according to the
overflow
property.
A multicol container can have more columns than it has room for due to:
a declaration that constrains the multicol container height
(e.g., using
height
or
max-height
).
In this case, additional column boxes are created in the wrapping direction
(by default, 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 in the wrapping direction
(by default, the inline direction for continuous contexts).
and additional column boxes are moved to the next fragment(s) for fragmented media.
Tests
multicol-overflow-000.xht
(live test)
(source)
multicol-overflowing-001.xht
(live test)
(source)
Tests to check that a scrollable container isn't split across multiple columns.
overflow-unsplittable-001.html
(live test)
(source)
overflow-unsplittable-002.html
(live test)
(source)
overflow-unsplittable-003.html
(live test)
(source)
Columns that appear outside the multicol container in continuous contexts
are called
overflow columns
Overflow columns in the inline direction can affect the height of the multicol container.
In this example, the height of the multi-column container has been constrained to a maximum height.
Also, the style sheet specifies that overflowing content should be visible:
div
max-height
em
overflow
visible
As a result, the number of columns is increased.
An overflow column is created in the inline direction.
In continuous contexts overflow columns in the inline direction can affect the height of the multicol container.
In this example a column appears in the overflow which has four lines of text.
The multicol container is made tall enough to accommodate this column.
The final column is an overflow column yet is taller than the others.
The container is tall enough for this column.
In fragmented contexts, the overflow content goes into columns in subsequent fragments.
Given the same content as in example 31
and a page box that only has room for five lines of formatted text,
this would appear on the first page:
The first three paragraphs appear on page one.
Assuming column balancing, this would appear on the second page:
The overflow column is moved onto page two.
In this example, explicit column breaks are generated after paragraphs:
break-after
column
As a result, the number of columns increases and the extra columns are added in the inline direction:
An overflow column is created in the inline direction.
In
paged media
, extra columns are shown on the next page.
Given the same code as the previous example,
the last paragraph appears on the second page.
This would appear on the first page:
The first three paragraphs appear on page one.
This would appear on the second page:
The overflow column is moved onto page two.
Due to column balancing, the last paragraph is split across three columns.
Appendix B. Changes
This appendix is
informative
Changes from the
First Public Working Draft
of 19 December 2024
Removed the special case of
column-rule-width
having a computed value of
when
column-rule-style
is
none
or
hidden
Issue 11494
Changes from the
Candidate Recommendation (CR) of CSS-MULTICOL-1 of 16 May 2024
Defines that the size of the columns in the block direction is maintained when
column-height
is set, even if there’s not enough content to fill a row.
Resolved 20 August 2025
Defines that spanners only span the current row of columns when wrapping.
Resolved 20 August 2025
Defines what happens when a spanner is larger than the available space in the block direction.
Resolved 20 August 2025
Updates the
columns
shorthand property to include
column-height
Resolved 6 Aug 2025
Adds a draft of proposed
column-wrap
property.
Adds the
column-height
property.
Resolved 30 Jan 2025
Adds the
::column
pseudo-element.
Resolved 27 Sep 2024
Adds a draft of proposed
and
auto
values for
column-span
Privacy Considerations
Multicol introduces no new privacy leaks.
Security Considerations
Multicol introduces no new security considerations.
Accessibility Considerations
Setting container height and line length can pose challenges for people with visual or cognitive disabilities.
See
WCAG Success Criterion 1.4.10 Reflow
and
WCAG 1.4.8 Visual Presentation
to understand user needs.
Acknowledgments
This document builds upon Håkon Wium Lie’s work in
[CSS3-MULTICOL]
and 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,
Morten Stenshorne,
Øyvind Stenhaug,
Peter Linss,
Peter-Paul Koch,
Robert O’Callahan,
Robert Stevahn,
Sergey Genkin,
Shelby Moore,
Steve Zilles,
Sylvain Galineau,
Tantek Çelik,
Till Halbach
Conformance
Document conventions
Conformance requirements are expressed with a combination of
descriptive assertions and RFC 2119 terminology. The key words “MUST”,
“MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”,
“RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this
document are to be interpreted as described in RFC 2119.
However, for readability, these words do not appear in all uppercase
letters in this specification.
All of the text of this specification is normative except sections
explicitly marked as non-normative, examples, and notes.
[RFC2119]
Examples in this specification are introduced with the words “for example”
or are set apart from the normative text with
class="example"
like this:
This is an example of an informative example.
Informative notes begin with the word “Note” and are set apart from the
normative text with
class="note"
, like this:
Note, this is an informative note.
Advisements are normative sections styled to evoke special attention and are
set apart from other normative text with
, like
this:
UAs MUST provide an accessible alternative.
Tests
Tests relating to the content of this specification
may be documented in “Tests” blocks like this one.
Any such block is non-normative.
Conformance classes
Conformance to this specification
is defined for three conformance classes:
style sheet
CSS
style sheet
renderer
UA
that interprets the semantics of a style sheet and renders
documents that use them.
authoring tool
UA
that writes a style sheet.
A style sheet is conformant to this specification
if all of its statements that use syntax defined in this module are valid
according to the generic CSS grammar and the individual grammars of each
feature defined in this module.
A renderer is conformant to this specification
if, in addition to interpreting the style sheet as defined by the
appropriate specifications, it supports all the features defined
by this specification by parsing them correctly
and rendering the document accordingly. However, the inability of a
UA to correctly render a document due to limitations of the device
does not make the UA non-conformant. (For example, a UA is not
required to render color on a monochrome monitor.)
An authoring tool is conformant to this specification
if it writes style sheets that are syntactically correct according to the
generic CSS grammar and the individual grammars of each feature in
this module, and meet all other conformance requirements of style sheets
as described in this module.
Partial implementations
So that authors can exploit the forward-compatible parsing rules to
assign fallback values, CSS renderers
must
treat as invalid (and
ignore
as appropriate
) any at-rules, properties, property values, keywords,
and other syntactic constructs for which they have no usable level of
support. In particular, user agents
must not
selectively
ignore unsupported component values and honor supported values in a single
multi-value property declaration: if any value is considered invalid
(as unsupported values must be), CSS requires that the entire declaration
be ignored.
Implementations of Unstable and Proprietary Features
To avoid clashes with future stable CSS features,
the CSSWG recommends
following best practices
for the implementation of
unstable
features and
proprietary extensions
to CSS.
Non-experimental implementations
Once a specification reaches the Candidate Recommendation stage,
non-experimental implementations are possible, and implementors should
release an unprefixed implementation of any CR-level feature they
can demonstrate to be correctly implemented according to spec.
To establish and maintain the interoperability of CSS across
implementations, the CSS Working Group requests that non-experimental
CSS renderers submit an implementation report (and, if necessary, the
testcases used for that implementation report) to the W3C before
releasing an unprefixed implementation of any CSS features. Testcases
submitted to W3C are subject to review and correction by the CSS
Working Group.
Further information on submitting testcases and implementation reports
can be found from on the CSS Working Group’s website at
Questions should be directed to the
public-css-testsuite@w3.org
mailing list.
Index
Terms defined by this specification
all
, in § 7.1
auto
value for column-count
, in § 4.3
value for column-fill
, in § 8.1
value for column-height
, in § 4.2
value for column-span
, in § 7.1
value for column-width
, in § 4.1
value for column-wrap
, in § 4.4
balance
, in § 8.1
balance-all
, in § 8.1
::column
, in § 4.8
column
, in § 3
column box
, in § 3
column-count
, in § 4.3
column-fill
, in § 8.1
column gap
, in § 3
column height
, in § 3
column-height
, in § 4.2
column rule
, in § 3
columns
, in § 4.5
column-span
, in § 7.1
column width
, in § 3
column-width
, in § 4.1
column-wrap
, in § 4.4
value for column-count
, in § 4.3
value for column-span
, in § 7.1
value for column-height
, in § 4.2
value for column-width
, in § 4.1
multicol container
, in § 3
multi-col line
, in § 3
multicol line
, in § 3
multi-col row
, in § 3
multicol row
, in § 3
multi-column container
, in § 3
multi-column formatting context
, in § 3
multi-column layout
, in § 1
multi-column line
, in § 3
multi-column row
, in § 3
multi-column spanner
, in § 7.1
multi-column spanning element
, in § 7.1
none
, in § 7.1
nowrap
, in § 4.4
overflow columns
, in § 9.2
row gap
, in § 3
row rule
, in § 3
spanner
, in § 7.1
spanning element
, in § 7.1
wrap
, in § 4.4
Terms defined by reference
[CSS-BORDERS-4]
defines the following terms:
hidden
none
[CSS-BOX-4]
defines the following terms:
content box
[CSS-BREAK-4]
defines the following terms:
fragment
fragmentation
fragmentation container
fragmentation context
widows
[CSS-DISPLAY-4]
defines the following terms:
anonymous box
block container
block formatting context
block-level box
containing block
containing block chain
display
formatting context
in-flow
independent formatting context
out of flow
out-of-flow
principal box
[CSS-GAPS]
defines the following terms:
column-rule
column-rule-color
column-rule-style
column-rule-width
row-rule
row-rule-color
row-rule-style
row-rule-width
[CSS-GRID-2]
defines the following terms:
grid container
grid item
[CSS-OVERFLOW-3]
defines the following terms:
overflow
scroll container
[CSS-OVERFLOW-5]
defines the following terms:
::scroll-marker
[CSS-POSITION-3]
defines the following terms:
absolutely positioned box
position
[CSS-SCROLL-SNAP-1]
defines the following terms:
scroll-margin
scroll-snap-align
scroll-snap-stop
[CSS-TABLES-3]
defines the following terms:
table wrapper box
[CSS-TRANSFORMS-1]
defines the following terms:
transform
[CSS-VALUES-4]
defines the following terms:
CSS-wide keywords
||
[CSS-WRITING-MODES-4]
defines the following terms:
block axis
inline axis
inline base direction
[CSS3-ALIGN]
defines the following terms:
column-gap
normal
row-gap
[CSS3-BREAK]
defines the following terms:
break-after
break-before
break-inside
orphans
[CSS3-SIZING]
defines the following terms:
available space
height
max-height
min-content
outer size
width
[MEDIAQUERIES-5]
defines the following terms:
paged media
[SELECTORS-4]
defines the following terms:
originating element
References
Normative References
[CSS-BORDERS-4]
Elika Etemad; et al.
CSS Borders and Box Decorations Module Level 4
. URL:
[CSS-BOX-4]
Elika Etemad.
CSS Box Model Module Level 4
. URL:
[CSS-BREAK-4]
Rossen Atanassov; Elika Etemad.
CSS Fragmentation Module Level 4
. URL:
[CSS-DISPLAY-4]
Elika Etemad; Tab Atkins Jr..
CSS Display Module Level 4
. URL:
[CSS-GAPS]
Kevin Babbitt.
CSS Gap Decorations Module Level 1
. URL:
[CSS-GRID-2]
Tab Atkins Jr.; et al.
CSS Grid Layout Module Level 2
. URL:
[CSS-OVERFLOW-3]
Elika Etemad; Florian Rivoal.
CSS Overflow Module Level 3
. URL:
[CSS-OVERFLOW-5]
Elika Etemad; Florian Rivoal; Robert Flack.
CSS Overflow Module Level 5
. URL:
[CSS-POSITION-3]
Elika Etemad; Tab Atkins Jr..
CSS Positioned Layout Module Level 3
. URL:
[CSS-SCROLL-SNAP-1]
Matt Rakow; et al.
CSS Scroll Snap Module Level 1
. URL:
[CSS-TABLES-3]
Keith Cirkel.
CSS Table Module Level 3
. URL:
[CSS-VALUES-3]
Tab Atkins Jr.; Elika Etemad.
CSS Values and Units Module Level 3
. URL:
[CSS-VALUES-4]
Tab Atkins Jr.; Elika Etemad.
CSS Values and Units Module Level 4
. URL:
[CSS-WRITING-MODES-4]
Elika Etemad; Koji Ishii.
CSS Writing Modes Level 4
. URL:
[CSS21]
Bert Bos; et al.
Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification
. URL:
[CSS3-ALIGN]
Elika Etemad; Tab Atkins Jr..
CSS Box Alignment Module Level 3
. URL:
[CSS3-BREAK]
Rossen Atanassov; Elika Etemad.
CSS Fragmentation Module Level 3
. URL:
[CSS3-SIZING]
Tab Atkins Jr.; Elika Etemad.
CSS Box Sizing Module Level 3
. URL:
[MEDIAQUERIES-5]
Tab Atkins Jr.; et al.
Media Queries Level 5
. URL:
[RFC2119]
S. Bradner.
Key words for use in RFCs to Indicate Requirement Levels
. March 1997. Best Current Practice. URL:
[SELECTORS-4]
Elika Etemad; Tab Atkins Jr..
Selectors Level 4
. URL:
Non-Normative References
[CSS-TRANSFORMS-1]
Simon Fraser; et al.
CSS Transforms Module Level 1
. URL:
[CSS3-MULTICOL]
Florian Rivoal; Rachel Andrew.
CSS Multi-column Layout Module Level 1
. URL:
[CSS3BOX]
Elika Etemad.
CSS Box Model Module Level 3
. URL:
Property Index
Name
Value
Initial
Applies to
Inh.
%ages
Animation type
Canonical order
Computed value
column-count
auto |
auto
block containers except table wrapper boxes
no
N/A
by computed value
per grammar
specified value
column-fill
auto | balance | balance-all
balance
multicol containers
no
N/A
discrete
per grammar
specified keyword
column-height
auto |
auto
block containers except table wrapper boxes
no
N/A
by computed value type
per grammar
the keyword auto or an absolute length
column-span
none |
none
in-flow block-level elements
no
N/A
discrete
per grammar
specified value
column-width
auto |
auto
block containers except table wrapper boxes
no
N/A
by computed value type
per grammar
the keyword auto or an absolute length
column-wrap
auto | nowrap | wrap
auto
multicol containers
no
n/a
discrete
per grammar
specified keyword
columns
[ <'column-width'> || <'column-count'> ] [ / <'column-height'> ]?
see individual properties
see individual properties
see individual properties
see individual properties
see individual properties
per grammar
see individual properties
Issues Index
The issue relating to the addition of this property is still open due to debate as to whether it’s required.
[Issue #11754]
What happens if you set a height on the multicol container, 'column-wrap: wrap' but no
column-height
Options are 1: The
column-wrap
property is ignored. 2: 'column-height: auto' resolves to the available space
in the multicol container and new rows of that size are created for the overflow,
thus honoring the 'column-wrap/wrap' value.
[Issue #11754]
This definition is insufficient.
Does
column-span: 1
count as
column-span: none
or does it create a spanner (which is a BFC)?
Which columns does it span?
How does that affect height calculations, and interact with column-fill
If
column-span: 1
does not do the same as
column-span: none
should this behave as
column-span: 1
or as
column-span: none
when the element is small enough?
MDN
break-after
In all current engines.
Firefox
65+
Safari
10+
Chrome
50+
Opera
37+
Edge
79+
Edge (Legacy)
12+
IE
10+
Firefox for Android
iOS Safari
Chrome for Android
Android WebView
Samsung Internet
Opera Mobile
37+
break-before
In all current engines.
Firefox
65+
Safari
10+
Chrome
50+
Opera
37+
Edge
79+
Edge (Legacy)
12+
IE
10+
Firefox for Android
iOS Safari
Chrome for Android
Android WebView
Samsung Internet
Opera Mobile
37+
break-inside
In all current engines.
Firefox
65+
Safari
10+
Chrome
50+
Opera
37+
Edge
79+
Edge (Legacy)
12+
IE
10+
Firefox for Android
iOS Safari
Chrome for Android
Android WebView
Samsung Internet
Opera Mobile
37+
MDN
column-count
In all current engines.
Firefox
52+
Safari
9+
Chrome
50+
Opera
11.1+
Edge
79+
Edge (Legacy)
12+
IE
10+
Firefox for Android
52+
iOS Safari
9+
Chrome for Android
Android WebView
50+
Samsung Internet
Opera Mobile
11.1+
MDN
column-fill
In all current engines.
Firefox
52+
Safari
9+
Chrome
50+
Opera
Edge
79+
Edge (Legacy)
12+
IE
10+
Firefox for Android
52+
iOS Safari
Chrome for Android
Android WebView
Samsung Internet
Opera Mobile
MDN
column-gap
In all current engines.
Firefox
1.5+
Safari
3+
Chrome
1+
Opera
11.1+
Edge
79+
Edge (Legacy)
12+
IE
10+
Firefox for Android
iOS Safari
Chrome for Android
Android WebView
Samsung Internet
Opera Mobile
11.1+
MDN
column-rule-color
In all current engines.
Firefox
52+
Safari
9+
Chrome
50+
Opera
11.1+
Edge
79+
Edge (Legacy)
12+
IE
10+
Firefox for Android
52+
iOS Safari
9+
Chrome for Android
Android WebView
50+
Samsung Internet
Opera Mobile
11.1+
MDN
column-rule-style
In all current engines.
Firefox
52+
Safari
9+
Chrome
50+
Opera
11.1+
Edge
79+
Edge (Legacy)
12+
IE
10+
Firefox for Android
52+
iOS Safari
9+
Chrome for Android
Android WebView
50+
Samsung Internet
Opera Mobile
11.1+
MDN
column-rule-width
In all current engines.
Firefox
52+
Safari
9+
Chrome
50+
Opera
11.1+
Edge
79+
Edge (Legacy)
12+
IE
10+
Firefox for Android
52+
iOS Safari
9+
Chrome for Android
Android WebView
50+
Samsung Internet
Opera Mobile
11.1+
MDN
column-rule
In all current engines.
Firefox
52+
Safari
9+
Chrome
50+
Opera
11.1+
Edge
79+
Edge (Legacy)
12+
IE
10+
Firefox for Android
52+
iOS Safari
9+
Chrome for Android
Android WebView
50+
Samsung Internet
Opera Mobile
11.1+
MDN
column-span
In all current engines.
Firefox
71+
Safari
9+
Chrome
50+
Opera
11.1+
Edge
79+
Edge (Legacy)
12+
IE
10+
Firefox for Android
iOS Safari
Chrome for Android
Android WebView
50+
Samsung Internet
Opera Mobile
11.1+
MDN
column-width
In all current engines.
Firefox
50+
Safari
9+
Chrome
50+
Opera
11.1+
Edge
79+
Edge (Legacy)
12+
IE
10+
Firefox for Android
50+
iOS Safari
9+
Chrome for Android
Android WebView
50+
Samsung Internet
Opera Mobile
11.1+
MDN
columns
In all current engines.
Firefox
52+
Safari
9+
Chrome
50+
Opera
11.1+
Edge
79+
Edge (Legacy)
12+
IE
10+
Firefox for Android
52+
iOS Safari
9+
Chrome for Android
50+
Android WebView
50+
Samsung Internet
Opera Mobile
11.1+
MDN
widows
Firefox
None
Safari
1.3+
Chrome
25+
Opera
9.2+
Edge
79+
Edge (Legacy)
12+
IE
8+
Firefox for Android
iOS Safari
Chrome for Android
Android WebView
Samsung Internet
Opera Mobile
US