CSS column-width Property

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

Definition and Usage

The column-width property sets the ideal width of columns in a multi-column layout. The browser fits as many columns as it can without normally making them narrower than that preferred size.

Use a length such as 12rem or 18ch, or auto (the initial value). It is not inherited. You can also set it through the columns shorthand. Pair it with column-gap for spacing. Unlike column-count, it favors readable line length and lets the column count change with container size.

Baseline widely available.

Not deprecated. Lengths and auto are safe in modern browsers. The value must be strictly positive — 0, negatives, and percentages are invalid.

CSS Syntax

syntax.css
column-width: auto | <length> | initial | inherit;

One keyword or a positive length. Examples: auto, 120px, 12rem, 18ch.

Property Values

ValueDescriptionTry it
autoBrowser chooses width from other properties such as column-count. Initial valueTry it
<length>Ideal column width such as 120px. Must be strictly positiveTry it
12remA relative length tied to the root font sizeTry it
18chAbout 18 character widths — useful for readable measureTry it
initialSets this property to its default value, autoTry it
inheritInherits this property from the parent elementTry it

How to Use column-width

Pick a comfortable column size and let the browser decide how many columns fit.

  1. Choose a block container for flowing text (an article or section).
  2. Set column-width to a positive length such as 12rem or 18ch.
  3. Optionally add column-gap and column-rule.
  4. Use column-count as well if you need a hard maximum number of columns.
PieceRequired?Role
Ideal widthYes (for this property)Positive length, or auto
Column countOptionalBrowser picks count from available space unless you set column-count
Gap / ruleOptionalSpace and dividers between columns
Exact pixel matchNot guaranteedIdeal width may stretch or shrink to fit the box

Live Preview

Only column-width changes. Resize the page to see columns appear or disappear.

With auto alone (no count), you usually get one column. A length lets the browser add columns as space allows.

Multi-column text

column-width: 12rem

CSS Examples

Each snippet focuses on column-width. Extra rules are only there so the columns can show. Use Try It Yourself for a live editor.

Example 1 — Ideal Pixel Width

Ask for columns about 120px wide; the browser picks how many fit.

CSS
<style>
  article {
    column-width: 120px;
  }
</style>

<article>
  <p>Text flows into as many columns as fit at about 120px each. Widen the window to see more columns appear.</p>
</article>
Try It Yourself

How It Works

  1. Set an ideal width. column-width: 120px is the lesson — a preferred column size.
  2. Count is flexible. The browser adds columns while each stays near that width.
  3. Not always exact. Columns may grow a little to fill leftover space.
  4. Responsive by design. Narrower viewports show fewer columns automatically.

Example 2 — auto with column-count

Use auto width when a fixed count should drive the layout.

CSS
<style>
  article {
    column-count: 3;
    column-width: auto;
  }
</style>

<article>
  <p>Three fixed columns. Width is auto, so each column shares the available space.</p>
</article>
Try It Yourself

How It Works

  1. Fix the count. column-count: 3 creates three columns.
  2. Leave width automatic. column-width: auto (the default) lets count decide sizing.
  3. Columns share the box. Each column grows or shrinks with the container.
  4. When to use this. Prefer auto when you care about column count more than line length.

Example 3 — Readable ch Width

Size columns by character measure for comfortable reading.

CSS
<style>
  article {
    column-width: 18ch;
  }
</style>

<article>
  <p>About eighteen characters per column. The browser adds more columns when the box is wide enough.</p>
</article>
Try It Yourself

How It Works

  1. Use a character unit. 18ch targets roughly eighteen “0” widths in the current font.
  2. Readable measure. Short columns stay easier to scan than very wide ones.
  3. Still an ideal. Actual width can adjust to fill the container.
  4. Great for articles. Pair with column-gap when you want newspaper-style prose.

Edge Cases & Pitfalls

If columns look wrong, one of these is usually why.

ideal

Width is preferred, not exact

Columns may stretch wider to fill leftover space, or shrink if the container is narrower than your value.

%

Percentages are invalid

column-width: 50% is dropped. Use a length such as px, em, rem, or ch.

zero

Zero and negatives are invalid

The length must be strictly positive. 0 or -10px will not create columns.

count

column-count can limit the result

With both properties set, the browser respects the count limit while still aiming for your width. Use one or both deliberately — or the columns shorthand.

auto

auto alone is often one column

Without column-count, column-width: auto typically stays a single column. Set a length when you want automatic multi-column flow.

Browser Support

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

✓ Baseline · Widely available

column-width

Supported in all modern browsers for auto and length values. Available across browsers since November 2016 (Baseline).

100% auto and lengths
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
column-width Widely supported

Bottom line: Safe everywhere for auto and positive lengths. Avoid percentages and zero. It is not a runtime API.

Key Takeaways

  • Role: set the preferred width of multi-column text columns.
  • Initial value: auto. Not inherited.
  • Responsive: more space usually means more columns at your ideal width.
  • vs count: use width for line length; use column-count to fix how many columns.

One line: column-width asks for a comfortable column size — the browser decides how many columns fit.

Frequently Asked Questions

It sets the ideal width of columns in a multi-column layout. The browser creates as many columns as fit without normally going below that preferred width.
The initial value is auto. Column width is then driven by other properties such as column-count.
column-width prefers a readable column size and lets the count flex. column-count fixes how many columns exist. You can combine both; column-count can limit the maximum number.
No. Percentage values are invalid. Use a length such as px, em, rem, or ch, or use auto.
No. It is an ideal width. Columns may grow wider to fill leftover space, or shrink if the container is narrower than the value.
It is Baseline and widely available in modern browsers. It is a browser CSS property, not a Node.js feature.

Next: columns

Learn the shorthand that sets column width and count together.

columns 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