CSS columns Property

Beginner
5 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The columns property is a shorthand for column-width and column-count. One declaration starts a multi-column layout for flowing text.

A length sets the ideal column width. An integer sets how many columns to use. You can set either or both, in either order. It is not inherited. Gap, rules, and spanning headings still need column-gap, column-rule, and column-span.

Baseline for width and count.

Not deprecated. Study columns: 3, columns: 12em, and columns: 12em 3. The newer / <column-height> form has limited support — skip it until browsers catch up.

CSS Syntax

syntax.css
columns: <column-width> || <column-count> | initial | inherit;

Examples: columns: 3; · columns: 12rem; · columns: 12rem 3; · columns: auto;

Property Values

ValueDescriptionTry it
<integer>Sets column-count (e.g. 3). Maximum columnsTry it
<length>Sets column-width (e.g. 12rem). Ideal widthTry it
12rem 3Width and count together. Order can be either wayTry it
autoBoth longhands stay automatic (initial-like behavior)Try it
initialResets to the initial shorthand (auto / auto)Try it
inheritInherits this property from the parent elementTry it

How to Use columns

Pick count, width, or both — then polish with gap and rules if needed.

  1. Choose a block container for flowing text.
  2. Set columns to an integer, a length, or both (e.g. 12rem 3).
  3. Add column-gap if columns feel cramped.
  4. Use column-span: all on headings that should break across columns.
PieceRequired?Role
Count (integer)OptionalCaps how many columns exist
Width (length)OptionalPreferred column size; count can flex
Both togetherOptionalIdeal width with a maximum count
Gap / rule / spanSeparateNot part of this shorthand

Live Preview

Only the columns shorthand changes on the sample paragraph.

An integer fixes count. A length prefers width. Both together combine the ideas.

Multi-column text

columns: 3

CSS Examples

Each snippet focuses on the columns shorthand only. Use Try It Yourself for a live editor.

Example 1 — Column Count

Fix three equal columns with an integer.

CSS
<style>
  article {
    columns: 3;
  }
</style>

<article>
  <p>Text is split into three columns. Width is automatic for each column.</p>
</article>
Try It Yourself

How It Works

  1. Use an integer. columns: 3 sets column-count to three.
  2. Width stays auto. Each column shares the container’s width.
  3. Fast start. One value is enough when you care about count only.
  4. Same as the longhand. Equivalent to column-count: 3 with width auto.

Example 2 — Ideal Width

Prefer a readable column size and let the count flex.

CSS
<style>
  article {
    columns: 12rem;
  }
</style>

<article>
  <p>Columns aim for about 12rem. More columns appear when the box is wider.</p>
</article>
Try It Yourself

How It Works

  1. Use a length. columns: 12rem sets column-width.
  2. Count is flexible. The browser adds columns as space allows.
  3. Responsive feel. Narrow screens get fewer columns automatically.
  4. Ideal, not exact. Actual width can stretch or shrink slightly to fit.

Example 3 — Width and Count

Combine an ideal width with a maximum column count.

CSS
<style>
  article {
    columns: 12rem 3;
  }
</style>

<article>
  <p>Prefer 12rem columns, but never more than three. Order can also be 3 12rem.</p>
</article>
Try It Yourself

How It Works

  1. Two values, one property. Length → width; integer → count.
  2. Either order works. 12rem 3 and 3 12rem mean the same pairing.
  3. Cap the maximum. You get readable columns without exceeding three.
  4. Still a shorthand. Same as setting both longhands yourself.

Edge Cases & Pitfalls

If the shorthand surprises you, check these points.

type

Length vs integer

3 is count. 3px or 3rem is width. Mixing them up changes the layout completely.

scope

Does not set gap or rule

columns only covers width and count (for study). Add column-gap and column-rule separately.

auto

auto alone is usually one column

Without a length or count, you typically stay single-column. Set a useful value to see multi-column flow.

height

Slash height is limited

columns: 3 / 5em targets newer column-height behavior. Support varies — prefer width and count for reliable pages.

grid

Not CSS Grid columns

Multi-column columns flows continuous text. Grid tracks are a different layout system.

Browser Support

columns is a browser CSS shorthand for multi-column layout. Node.js, Deno, and Bun do not apply it.

✓ Baseline · Widely available

columns

column-width and column-count values are widely supported (Baseline since March 2017). The optional / column-height form is not part of these numbers.

100% Width and count
Google Chrome All versions
Full support
Mozilla Firefox All versions
Full support
Apple Safari All versions
Full support
Microsoft Edge All versions
Full support
Opera All versions
Full support
Samsung Internet All versions
Full support
Internet Explorer 10+
Full support
columns Widely supported

Bottom line: Safe for count, width, and both together. Treat / height as limited. It is not a runtime API.

Key Takeaways

  • Role: shorthand for column-width and column-count.
  • Values: integer = count; length = width; both allowed in either order.
  • Initial: both longhands default to auto. Not inherited.
  • Not included: gap, rule, and span stay separate properties.

One line: columns is the quick way to turn on multi-column text — set count, width, or both.

Frequently Asked Questions

columns is a shorthand for column-width and column-count. You can set an ideal width, a column count, or both in one declaration.
Both longhands start as auto, so columns: auto is equivalent to column-width: auto and column-count: auto.
A length sets column-width. A positive integer sets column-count. You can write them in either order when both are present.
No. Use column-gap, column-rule, and column-span as separate properties.
The slash form sets column-height in newer specs. Support is limited — prefer width and count alone for study and production today.
Width and count values are Baseline and widely available. It is a browser CSS property, not a Node.js feature.

Next: content

Learn how the CSS content property inserts generated text and images.

content tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful