The grid-auto-flow property controls how auto-placed items fill a grid. Choose row or column for the fill direction, and optionally add dense to pack into earlier empty cells.
Set it on the grid container. It is not inherited. The initial value is row. Explicitly placed items (with grid-area, grid-row, or grid-column) keep their positions; only auto-placed items follow this property.
Standard-track.
Not deprecated and not experimental. Baseline Widely available since 2017. Part of modern CSS Grid Layout.
Without dense, the algorithm never backtracks. Empty cells beside a spanning item can stay empty.
alone
dense alone means row dense
If you omit row or column, the direction defaults to row.
Compatibility
Browser Support
grid-auto-flow is a browser CSS property for CSS Grid auto-placement. Node.js, Deno, and Bun do not apply it.
✓ Baseline · Widely available
grid-auto-flow
Supported in Chrome 57+, Firefox 52+, Safari 10.1+, and Edge 16+. Internet Explorer does not support modern Grid.
97%Global support
Google Chrome57+
Full support
Mozilla Firefox52+
Full support
Apple Safari10.1+
Full support
Microsoft Edge16+
Full support
Opera44+
Full support
Samsung Internet6.2+
Full support
Internet ExplorerNo modern Grid
Not supported
grid-auto-flowWidely supported
Bottom line: Safe in current browsers. Use row or column for direction; add dense only when packing holes is worth reordering items.
Remember
Key Takeaways
Role: steer auto-placement by row or column, with optional dense packing.
Initial:row. Not inherited.
Auto only. Explicit line placement ignores this property.
Dense packs holes but can reorder items visually.
One line:grid-auto-flow is the map for how unplaced grid items walk through the tracks.
Frequently Asked Questions
It controls how auto-placed grid items fill the grid: by row or by column, and whether empty holes can be packed with dense.
The initial value is row. Items fill each row in turn and add new rows as needed.
row fills across a row first, then moves to the next row. column fills down a column first, then moves to the next column.
dense lets later smaller items fill earlier empty cells left by larger items. Items may appear out of source order. Without dense, placement only moves forward (sparse).
No. Items with grid-area, grid-row, or grid-column keep those positions. Only auto-placed items follow grid-auto-flow.
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.