auto-fit
collapses empty tracksgrid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
auto-fill
keeps empty tracksgrid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
auto-fit
With fewer items than columns, auto-fit collapses empty tracks to 0 and stretches remaining items to fill the full container width.
Use when you want items to always fill the row, even with few items.
auto-fill
With fewer items than columns, auto-fill keeps empty tracks at their minimum width — items stay at their natural size.
Use when you want a fixed column rhythm regardless of item count.
auto-fit CSS
auto-fill CSS