Home CSS Properties columns CSS columns Property Definition
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.
Syntax
CSS Syntax columns: <column-width> || <column-count> | initial | inherit ;
Examples: columns: 3; · columns: 12rem; · columns: 12rem 3; · columns: auto;
Values
Property Values Value Description Try it <integer>Sets column-count (e.g. 3). Maximum columns Try it<length>Sets column-width (e.g. 12rem). Ideal width Try it12rem 3Width and count together. Order can be either way Try itautoBoth longhands stay automatic (initial-like behavior) Try itinitialResets to the initial shorthand (auto / auto) Try itinheritInherits this property from the parent element Try it
Approach
How to Use columns Pick count, width, or both — then polish with gap and rules if needed.
Choose a block container for flowing text. Set columns to an integer, a length, or both (e.g. 12rem 3). Add column-gap if columns feel cramped. Use column-span: all on headings that should break across columns. Piece Required? Role Count (integer) Optional Caps how many columns exist Width (length) Optional Preferred column size; count can flex Both together Optional Ideal width with a maximum count Gap / rule / span Separate Not part of this shorthand
Try it
Live Preview Only the columns shorthand changes on the sample paragraph.
Code
CSS Examples Each snippet focuses on the columns shorthand only. Use Try It Yourself for a live editor.
1. Count 2. Width 3. Both Example 1 — Column Count Fix three equal columns with an integer.
<style>
article {
columns: 3;
}
</style>
<article>
<p>Text is split into three columns. Width is automatic for each column.</p>
</article> Text is split into three columns. Width is automatic for each column. Extra words help fill the columns for study.
How It Works Use an integer. columns: 3 sets column-count to three.Width stays auto. Each column shares the container’s width.Fast start. One value is enough when you care about count only.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.
<style>
article {
columns: 12rem;
}
</style>
<article>
<p>Columns aim for about 12rem. More columns appear when the box is wider.</p>
</article> Columns aim for about 12rem. More columns appear when the box is wider. Extra sample text shows the multi-column flow.
How It Works Use a length. columns: 12rem sets column-width.Count is flexible. The browser adds columns as space allows.Responsive feel. Narrow screens get fewer columns automatically.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.
<style>
article {
columns: 12rem 3;
}
</style>
<article>
<p>Prefer 12rem columns, but never more than three. Order can also be 3 12rem.</p>
</article> Prefer 12rem columns, but never more than three. Order can also be 3 12rem. Extra text fills the layout for a clear demo.
How It Works Two values, one property. Length → width; integer → count.Either order works. 12rem 3 and 3 12rem mean the same pairing.Cap the maximum. You get readable columns without exceeding three.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 columnWithout 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.
Compatibility
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.
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.
Remember
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 What does the CSS columns property do? columns is a shorthand for column-width and column-count. You can set an ideal width, a column count, or both in one declaration.
What is the default value of columns? Both longhands start as auto, so columns: auto is equivalent to column-width: auto and column-count: auto.
How do I know if a value is width or count? A length sets column-width. A positive integer sets column-count. You can write them in either order when both are present.
Does columns include gap and rule? No. Use column-gap, column-rule, and column-span as separate properties.
What about columns: 3 / 5em? The slash form sets column-height in newer specs. Support is limited — prefer width and count alone for study and production today.
Which browsers support columns? 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 Developer, cloud engineer, and technical writer
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
Helpful Share Copy link Suggestion