CSS Grid to have minimum number of columns possible with auto flow after wrapping
问题 Is it possible to have a CSS grid with auto flow that minimises the number of columns after wrapping? How? I have a grid with 6 items with auto-placement. Once not all 6 of them fit in one row, I'd like to have 3 columns and 2 rows, instead of 5 columns and 1 row, with only one element on the second one. I'd like to avoid media queries, if possible. A visual representation of what I'd like to do: 1) If all 6 items fit in one row, show them in one row. | OOO OOO OOO OOO OOO OOO | | O1O O2O O3O