grid-auto-flow
Widely availableSince 201797% of users
Determines the algorithm used to automatically place grid items that aren't specifically positioned. It can fill row by row, column by column or try to fill gaps 'densely'.
What's modern
From web-features, MDN's browser data and our snippets, checked dailyClassic, with newer partsIt has worked everywhere since October 2017, and it keeps getting newer values.
Newer parts of grid-auto-flow
columnBaseline Jan 2020, Widely Jul 2022denseBaseline Jan 2020, Widely Jul 2022rowBaseline Jan 2020, Widely Jul 2022
See how modern your own CSS is.Check your CSS →
Quick facts
- Initial value
row- Inherited
- No
- Applies to
- grid containers
- Animation type
- discrete
Quick example
.gallery {
display: grid;
/* Tells the browser to fill gaps when items vary in size */
grid-auto-flow: dense;
}Values
rowcolumndensegrid-auto-flow browser support
BaselineWidely availableThis feature is well established and works across many devices and browser versions. It has been available across browsers since 2017.Safe to use without fallbacks.
Usage97%of people can use this3% use a browser without it.
Browsers
57+
52+
10.1+
16+Mobile
57+Android
52+Android
10.3+iOS