CSS grid-auto-columns Property

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

Definition and Usage

The grid-auto-columns property sets the size of implicitly created column tracks. Implicit columns appear when items need more columns than grid-template-columns defines—for example with grid-auto-flow: column, or when an item is placed past the last explicit column.

It is set on the grid container, is not inherited, and the initial value is auto. Explicit columns from grid-template-columns are unchanged. For implicit rows, use grid-auto-rows.

Standard-track.

Not deprecated and not experimental. Baseline Widely available. Part of modern CSS Grid Layout.

CSS Syntax

syntax.css
grid-auto-columns: <track-size>+ | initial | inherit;

A track size can be auto, a length, a percentage, fr, minmax(), min-content, max-content, or fit-content().

Property Values

ValueDescriptionTry it
autoDefault. Size from content (similar to a flexible min/max content range)Try it
<length>Fixed width such as 80pxTry it
<flex>Share leftover space, such as 1frTry it
minmax()Clamp between a minimum and maximum sizeTry it
initialResets to autoTry it
inheritTakes the parent’s grid-auto-columnsTry it

You can list several sizes to repeat a pattern across successive implicit columns.

How to Use grid-auto-columns

Create a grid that needs extra columns, then size those extras on the container.

  1. Set display: grid on the container.
  2. Cause implicit columns: use grid-auto-flow: column, or place an item past the explicit columns.
  3. Set grid-auto-columns to the width you want for those new columns.
  4. Keep planned columns in grid-template-columns; this property does not replace that list.
PieceRequired?Role
Grid containerYesdisplay: grid on the parent
Implicit columnsYesWithout extra columns, the property has nothing to size
Track sizeYesauto, length, fr, minmax(), and related values

Live Preview

Two fixed rows and grid-auto-flow: column. Six items create three implicit columns. Only grid-auto-columns changes.

Items fill down each column, then move to a new column. Those new columns use grid-auto-columns.

Sample
1
2
3
4
5
6

grid-auto-columns: 80px

CSS Examples

Each snippet focuses on grid-auto-columns. Use Try It Yourself for a live editor.

Example 1 — Fixed Implicit Columns

Give every auto-created column a fixed width.

CSS
<style>
  section {
    display: grid;
    grid-template-rows: 60px 60px;
    grid-auto-flow: column;
    grid-auto-columns: 80px;
  }
</style>

<section>
  <div>1</div>
  <div>2</div>
  <div>3</div>
  <div>4</div>
  <div>5</div>
  <div>6</div>
</section>
Try It Yourself

How It Works

  1. Fix the rows. Two 60px rows come from grid-template-rows.
  2. Flow by column. grid-auto-flow: column fills down, then starts a new column.
  3. Size new columns. grid-auto-columns: 80px makes each new column 80px wide.
  4. Count the columns. Six items need three columns. All three are implicit and use that 80px size.

Example 2 — Flexible fr Columns

Share leftover width evenly among implicit columns.

CSS
<style>
  section {
    display: grid;
    grid-template-rows: 60px 60px;
    grid-auto-flow: column;
    grid-auto-columns: 1fr;
  }
</style>

<section>
  <div>1</div>
  <div>2</div>
  <div>3</div>
  <div>4</div>
  <div>5</div>
  <div>6</div>
</section>
Try It Yourself

How It Works

  1. Same flow. Column auto-flow still creates three implicit columns.
  2. Use fractions. 1fr means each of those columns gets an equal share of free space.
  3. Compare with 80px. Fixed lengths stay constant; fr grows with the container.
  4. Outside minmax. A bare fr acts like minmax(auto, 1fr).

Example 3 — minmax() Range

Keep implicit columns at least 60px wide, but allow them to grow.

CSS
<style>
  section {
    display: grid;
    grid-template-rows: 60px 60px;
    grid-auto-flow: column;
    grid-auto-columns: minmax(60px, 1fr);
  }
</style>

<section>
  <div>1</div>
  <div>2</div>
  <div>3</div>
  <div>4</div>
  <div>5</div>
  <div>6</div>
</section>
Try It Yourself

How It Works

  1. Set a floor. The first argument, 60px, is the minimum column width.
  2. Set a ceiling preference. 1fr lets columns share remaining space up to that flexible size.
  3. Protect narrow viewports. Columns will not shrink below 60px when space is tight.
  4. Same idea as templates. minmax() works here just like in grid-template-columns.

Edge Cases & Pitfalls

If nothing changes, you may not be creating implicit columns.

implicit

Only sizes implicit columns

Tracks from grid-template-columns ignore this property. You need extra columns from flow or placement to see an effect.

flow

Default flow creates rows, not columns

With grid-auto-flow: row (the default), overflow items make new rows. Use grid-auto-rows for those, or switch flow to column.

%

Percentages need a definite container size

If the grid’s inline size is indefinite, a percentage track size is treated like auto.

pattern

Multiple values form a repeating pattern

grid-auto-columns: 80px 120px makes the first implicit column 80px, the next 120px, then repeats.

rows

Do not confuse with grid-auto-rows

This property is for columns only. Implicit row height is controlled by grid-auto-rows.

Browser Support

grid-auto-columns is a browser CSS property for CSS Grid. Node.js, Deno, and Bun do not apply it.

✓ Baseline · Widely available

grid-auto-columns

Supported in Chrome 57+, Firefox 52+, Safari 10.1+, and Edge 16+. Internet Explorer does not support modern Grid.

97% Global support
Google Chrome 57+
Full support
Mozilla Firefox 52+
Full support
Apple Safari 10.1+
Full support
Microsoft Edge 16+
Full support
Opera 44+
Full support
Samsung Internet 6.2+
Full support
Internet Explorer No modern Grid
Not supported
grid-auto-columns Widely supported

Bottom line: Safe in current browsers. Use it when auto-flow or placement creates columns beyond grid-template-columns.

Key Takeaways

  • Role: size columns the grid creates automatically.
  • Not for templates. Explicit columns still use grid-template-columns.
  • Initial: auto. Not inherited.
  • Pair with grid-auto-flow: column or out-of-range placement to create those columns.

One line: grid-auto-columns is the width rule for columns the grid invents on the fly.

Frequently Asked Questions

It sets the size of column tracks that the grid creates automatically when items need columns beyond grid-template-columns.
The initial value is auto, which sizes each implicit column from its content.
grid-template-columns defines the explicit columns you plan. grid-auto-columns only sizes extra (implicit) columns created by placement or auto-flow.
When grid-auto-flow is column, or when an item is placed on a column line outside the explicit template, the browser adds columns and sizes them with grid-auto-columns.
No. Columns listed in grid-template-columns keep those sizes. Only newly created columns use grid-auto-columns.
It is Baseline Widely available: Chrome 57+, Firefox 52+, Safari 10.1+, and Edge 16+. Internet Explorer does not support modern Grid. It is a browser CSS property, not a Node.js feature.

Next: grid-auto-flow

Control how auto-placed items fill the grid.

grid-auto-flow 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