First Public Working Draft · css-multicol

CSS Multi-column Layout

6 properties, 1 selector defined by this specification, all known to at least one browser .

Each feature in detail

column-count

Property Baseline: widely availablesince September 2019

MDN The column-count CSS property breaks an element's content into the specified number of columns.

Live preview Example from MDN
#example-element {
  width: 100%;
  text-align: left;
}

Syntax

auto | <integer [1,∞]>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

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

Browser support

First browser version supporting column-count
Chrome 50
Edge 12
Firefox 52
Safari 9
Chrome Android 50
Safari iOS 9

First version with support, from MDN browser-compat-data.

column-fill

Property Baseline: widely availablesince September 2019

MDN The column-fill CSS property controls how an element's contents are balanced when broken into columns.

Live preview Example from MDN
#example-element {
  width: 100%;
  height: 90%;
  columns: 3;
  text-align: left;
}

Syntax

auto | balance | balance-all

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
balance
Applies to
multicol containers
Inherited
no
Percentages
N/A
Computed value
specified keyword
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting column-fill
Chrome 50
Edge 12
Firefox 52
Safari 9
Chrome Android 50
Safari iOS 9

First version with support, from MDN browser-compat-data.

column-height

Property Limited availability Experimental Modern CSS: column-wrap

MDN The column-height CSS property specifies the height of the columns in a CSS multi-column layout.

Live preview Example from MDN
ol {
  column-width: 150px;
  gap: 2em;
  column-height: 3em;
}

Syntax

auto | <length [0,∞]>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

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

Browser support

First browser version supporting column-height
Chrome 145
Edge 145
Firefox No
Safari No
Chrome Android 145
Safari iOS No

First version with support, from MDN browser-compat-data.

column-span

Property Baseline: widely availablesince January 2023

MDN The column-span CSS property makes it possible for an element to span across all columns when its value is set to all.

Live preview Example from MDN
.multicol-element {
  width: 100%;
  text-align: left;
  column-count: 3;
}

.multicol-element p {
  margin: 0;
}

#example-element {
  background-color: rebeccapurple;
  padding: 10px;
  color: white;
}

Syntax

none | <integer [1,∞]> | all | auto

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

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

Browser support

First browser version supporting column-span
Chrome 50
Edge 12
Firefox 71
Safari 9
Chrome Android 50
Safari iOS 9

First version with support, from MDN browser-compat-data.

column-wrap

Property Limited availability Experimental Modern CSS: column-wrap

MDN The column-wrap CSS property specifies the wrapping behavior of overflow columns in a CSS multi-column layout.

Live preview Example from MDN
ol {
  column-width: 150px;
  gap: 2em;
  column-height: 3em;
}

Syntax

auto | nowrap | wrap

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
auto
Applies to
multicol containers
Inherited
no
Percentages
n/a
Computed value
specified keyword
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting column-wrap
Chrome 145
Edge 145
Firefox No
Safari No
Chrome Android 145
Safari iOS No

First version with support, from MDN browser-compat-data.

columns

Property Baseline: widely availablesince September 2019 Modern CSS: column-wrap

MDN The columns CSS shorthand property sets the maximum number of columns to use when drawing an element's contents, along with the minimum width and maximum height of the element's columns.

Live preview Example from MDN
#example-element {
  min-width: 21rem;
  text-align: left;
}

Syntax

[ <'column-width'> || <'column-count'> ] [ / <'column-height'> ]?

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
see individual properties
Applies to
see individual properties
Inherited
see individual properties
Percentages
see individual properties
Computed value
see individual properties
Canonical order
per grammar
Animation type
see individual properties
Longhands
column-width, column-count, column-height

Browser support

First browser version supporting columns
Chrome 50
Edge 12
Firefox 52
Safari 9
Chrome Android 50
Safari iOS 9

First version with support, from MDN browser-compat-data.

::column

Selector Limited availability Experimental Modern CSS: ::column

Spec The ::column pseudo-element represents the individual columns in a multi-column container. It only exists on multi-column containers.

MDN The ::column CSS pseudo-element represents the individual columns generated when a container is set to display its content in multiple columns via CSS multi-column layout. The ::column pseudo-element enables applying styles that do not affect the layout to these generated fragments.

Live preview Example from MDN
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Helvetica", "Arial", sans-serif;
}

ul {
  width: 100vw;
  height: 300px;
  padding: 10px;

  overflow-x: scroll;
  scroll-snap-type: x mandatory;

  columns: 1;
  text-align: center;
}

li {
  list-style-type: none;

  display: inline-block;
  height: 100%;
  width: 200px;
  text-align: left;

  background-color: #eeeeee;
  outline: 1px solid #dddddd;
  padding: 0 20px;
  margin: 0 10px;
}

li:nth-child(even) {
  background-color: cyan;
}

ul::column {
  scroll-snap-align: center;
}

Syntax

::column

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting ::column
Chrome 135
Edge 135
Firefox No
Safari No
Chrome Android 135
Safari iOS No

First version with support, from MDN browser-compat-data.