CSS Portal

CSS column-count Property

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!

Description

The column-count property determines how many columns the user agent should create when an element is laid out as a multicol container. It is the primary mechanism for splitting block-level flow into multiple vertical tracks so text and other flow content can be presented in a newspaper- or magazine-style layout. Using this property tells the layout system to divide the available inline space into discrete columns and flow inline content down the first column, then into subsequent columns in normal reading order.

This property works in concert with other multicolumn controls: for example, column-width provides a sizing hint that the UA may use when deciding an appropriate column geometry, while the column-gap determines how much space is left between the columns and thus affects the usable width for each column. There is also a shorthand, columns, which combines count and width concerns; these properties together influence whether the engine produces the requested number of columns or adjusts them to fit available space.

How content is distributed among columns is influenced by balancing and fragmentation rules. The behavior of filling columns (whether the engine attempts to even out column heights or fills one before another) is governed by column-fill, and breaking rules inside blocks - such as avoiding breaks inside certain elements - are governed by properties like break-inside. Floats, positioned elements, and column-spanning elements can interact with the column flow in subtle ways (for example, some elements may span all columns or remain anchored within a single column), so designers often combine column settings with explicit break and span controls to achieve the desired visual grouping and reading order.

In responsive layouts, using column-count requires attention to the container’s available inline size: the same column count can produce very narrow columns on small viewports or very wide columns on large ones. Authors frequently combine media queries or pair column-width with the column count to create layouts that adapt gracefully, or they use the shorthand columns to express intent in a single declaration. Finally, because multi-column layout changes the visual flow but preserves DOM order, it generally maintains logical reading order for accessibility and assistive technologies even when text is visually arranged into multiple columns.

Definition

Initial value
auto
Applies to
Block level elements
Inherited
No
Computed value
Specified value
Animatable
No
JavaScript syntax
object.style.columnCount

Interactive Demo

The rusty swing set creaked a lonely lullaby in the twilight, shadows lengthening like grasping fingers across the dew-kissed grass. A lone dandelion seed, adrift on the breeze, whispered secrets of faraway fields, of dandelion suns and galaxies spun from fluff. Somewhere, beyond the veil of dusk, a coyote laughed, echoing through the stillness like a forgotten memory.

Syntax

column-count: <integer> | auto

Values

  • <integer>An integer value that specifies the number of columns in the multi-column element. Values must be greater than 0. When column-width is specified with column-count and both have non-auto values, the integer value defines the maximum number of columns.
  • autoIs a keyword indicating that the number of columns should be determined by other CSS properties, like column-width.

Example

<div class="example">
<h2>CSS column-count Example</h2>
<div class="multicol">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer nec odio. Praesent libero. Sed cursus ante dapibus diam.</p>
<p>Sed nisi. Nulla quis sem at nibh elementum imperdiet. Duis sagittis ipsum. Praesent mauris.</p>
<p>Fusce nec tellus sed augue semper porta. Mauris massa. Vestibulum lacinia arcu eget nulla.</p>
</div>
</div>
.example {
    max-width: 800px;
    margin: 40px auto;
    font-family: Arial, sans-serif;
    line-height: 1.6;
}

.multicol {
    column-count: 3;
    column-gap: 24px;
    column-rule: 1px solid #ccc;
    padding: 16px;
    background: #fafafa;
    border-radius: 6px;
}

.multicol p {
    margin: 0 0 1em;
}

@media (max-width: 600px) {
    .multicol {
        column-count: 1;
    }
}

Browser Support

The following information will show you the current browser support for the CSS column-count property. Hover over a browser icon to see the version that first introduced support for this CSS property.

This property is supported by all modern browsers.
Desktop
Chrome
Edge
Firefox
Opera
Safari
Tablets & Mobile
Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-

Last updated by CSSPortal on: 1st January 2026

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!