Defining grids with flexible rows

grid-auto-flow

Use this property to define how new elements are positioned in layouts that are configured with auto-columns or auto-rows.

Property values

Specify one of these keywords:

row New items are placed by filling each row, adding new rows when space runs out
column New items are placed by filling each column, adding new columns when space runs out
row dense Same as row, but if the new item is smaller than the previously added items, it will attempt to find an empty space higher in the grid and use it if possible
column dense Same as column, but if the new item is smaller than the previously added items, it will attempt to find an empty space left of the others and use it if possible

Examples

grid-auto-flow: column;
grid-auto-flow
0

style > grid > grid-auto-flowDefining grids with flexible rows

🔗 🔎