The grid-auto-columns property controls how wide automatically created grid columns become when your layout needs more columns than you explicitly defined.
01
Implicit
Auto columns.
02
auto
Default size.
03
px / rem
Fixed width.
04
minmax
Min & max.
05
fr
Flexible tracks.
06
Container
Grid parent.
Fundamentals
Introduction
The grid-auto-columns property in CSS is used in grid layouts to define the size of implicitly created columns. When items are placed outside the explicitly defined grid, new columns are created automatically.
The grid-auto-columns property specifies the size of these newly created columns, ensuring a consistent layout.
Definition and Usage
Set grid-auto-columns on a grid container alongside display: grid and grid-template-columns. Explicit columns come from your template; any extra columns the browser generates use the grid-auto-columns size. Pair with grid-auto-flow: column when items should fill rows first and spill into new columns.
💡
Beginner Tip
If all items fit within your grid-template-columns and you use default row flow, you may not see implicit columns. Add more items or change auto-flow to trigger new columns.
Foundation
📝 Syntax
The syntax for the grid-auto-columns property is straightforward. You can specify a single value or multiple values separated by spaces:
syntax.css
element{grid-auto-columns:value;}
Here, value can be any valid length, percentage, or keyword that defines the column size.
The default value of the grid-auto-columns property is auto, which means the size of the implicitly created columns will be determined by the content inside them.
Syntax Rules
Applies to grid containers only, not individual grid items.
Accepts one or more track sizes separated by spaces for repeating patterns.
Affects implicit columns only; use grid-template-columns for explicit tracks.
The property is not inherited.
Often used with grid-auto-flow to control how items create implicit tracks.
Cheat Sheet
⚡ Quick Reference
Question
Answer
Initial value
auto
Applies to
Grid containers
Inherited
No
Controls
Implicit column size
Related property
grid-template-columns
Reference
💎 Property Values
Value
Description
length
A specific size in units such as px, em, rem, etc.
percentage
A percentage value relative to the grid container
auto
Automatically determines the column size based on the content
min-content
The smallest size that fits the content
max-content
The largest size that fits the content
fit-content()
A function that defines the size within a specified limit
fr
A fraction of the available space
Preview
👀 Live Preview
Two explicit columns plus implicit columns at 4rem (items 5–6, highlighted):
1
2
3
4
5
6
Hands-On
Examples Gallery
Set implicitly created columns to 100 pixels, then explore minmax, content keywords, and a horizontal card strip.
🔢 Fixed Implicit Columns
Start with the reference example — implicit columns sized at 100 pixels.
Example 1 — 100px Auto Columns
Create a grid where extra columns beyond the template are 100px wide.
Each card becomes its own implicit column at 10rem. Column auto-flow lays them in a horizontal strip that scrolls when space runs out.
A11y
♿ Accessibility
Ensure horizontal scroll areas are keyboard accessible when using column auto-flow galleries.
Do not rely on column width alone to convey data relationships; use table headers or labels.
Test zoom and small screens so implicit columns do not cause unreadable overflow.
Keep touch targets wide enough even when min-content shrinks columns.
Maintain logical tab order when items flow into implicit columns.
🧠 How grid-auto-columns Works
1
Explicit columns are defined
grid-template-columns sets the planned column tracks.
Template
2
Extra columns are needed
Auto-placement or item placement creates implicit columns beyond the template.
Implicit tracks
3
grid-auto-columns applies
Each new column uses the size you specified, such as 100px or minmax().
Sizing
=
▦
Consistent extra columns
Implicit columns stay uniform even as the grid grows horizontally.
Compatibility
🖥 Browser Compatibility
The grid-auto-columns property is supported in most modern browsers, including recent versions of Chrome, Firefox, Safari, Edge, and Opera.
✓ Baseline · Modern browsers
grid-auto-columns everywhere
Implicit column sizing works in all major modern grid implementations.
97%Modern browser support
Google Chrome57+ · Desktop & Mobile
Full support
Mozilla Firefox52+ · Desktop & Mobile
Full support
Apple Safari10.1+ · macOS & iOS
Full support
Microsoft Edge16+ · 79+ Chromium
Full support
Opera44+
Full support
grid-auto-columns property97% supported
Bottom line: Safe for modern projects. Combine with display: grid and explicit column templates.
Wrap Up
🎉 Conclusion
The grid-auto-columns property is a useful tool for managing the size of implicitly created columns in a grid layout. By defining the size of these columns, you can ensure that your grid layout remains consistent and visually appealing, even when new columns are added automatically.
Experiment with different values to see how this property can enhance the flexibility and responsiveness of your grid designs. Start with fixed pixels, then try minmax() and content keywords for smarter sizing.
Define explicit columns with grid-template-columns
Set grid-auto-columns for overflow cases
Use minmax() for flexible implicit tracks
Pair with grid-auto-flow: column for horizontal layouts
Test with enough items to trigger implicit columns
❌ Don’t
Confuse with grid-template-columns
Apply on grid items instead of containers
Expect changes without implicit columns
Use tiny min-content for touch targets
Forget overflow handling on small screens
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about grid-auto-columns
Use these points when sizing implicit columns.
5
Core concepts
▦01
Implicit cols
Auto-created.
Purpose
auto02
Default auto
Content size.
Default
100px03
Fixed width
Length units.
Syntax
minmax04
Flexible
Min & max.
Pattern
template05
Explicit first
Then auto cols.
Workflow
❓ Frequently Asked Questions
grid-auto-columns sets the size of columns that are created automatically when grid items need more columns than grid-template-columns defines.
The default value is auto, which sizes implicit columns based on their content.
Explicit columns come from grid-template-columns. Implicit columns are generated when placement or auto-flow creates extra columns beyond those definitions.
grid-template-columns defines the main column tracks you plan for. grid-auto-columns only affects extra columns the browser creates when needed.
It applies when the grid creates implicit columns, such as when grid-auto-flow is column or when items are placed on column lines beyond the explicit template.