Skip to content
Tutorials Center
My learning

Topics

CSS Reference ยท Multi-column and Fragmentation

The column-count property

Reference for the CSS column-count property: set how many columns text and content flow into, how it interacts with column-width, with examples.

The column-count property sets the number of columns an element divides its content into. The browser balances the content across them and shares the available width after subtracting the gaps.

CSS
.list {
  column-count: 2;
  column-gap: 1.5rem;
}

Try it

Two and three columns

Syntax

CSS
column-count: auto | <integer>;
  • Initial value: auto
  • Applies to: non-replaced block containers (except table wrappers), flex containers and grid containers
  • Inherited: no
  • Animatable: yes, as an integer
  • Computed value: as specified

Values

Value Description
auto The number of columns is determined by other properties such as column-width; with neither set there is one column.
<integer> A whole number greater than 0: the number of columns, or the maximum when column-width is also set.

Usage notes

  • With column-width it is a maximum. column-count: 4; column-width: 15rem can produce fewer than 4 columns in narrow containers, which makes the layout responsive.
  • Alone it is fixed. column-count: 3 stays three columns even on a phone, giving very narrow text. Pair it with a media query or use column-width instead.
  • Zero and negative values are invalid.
  • Content is balanced by default (see column-fill), so columns end at roughly the same height.
  • Lists: a long ul of short words works very well with columns; add break-inside: avoid to list items that wrap.
  • Accessibility: on screens, users must scroll vertically to read all columns top to bottom, which suits short content only.

Browser support

Supported in all current browsers.