The grid lesson nobody asked for
Why the implicit grid is where every layout question actually starts.
Every layout question I get eventually turns out to be the same question: where did that extra row come from. It is always the implicit grid, and it is never explained in the place people go looking.
The row you never declared
Content that overflows the tracks you named does not vanish — it gets
a new, implicit row, sized by grid-auto-rows, which
defaults to auto and surprises everyone equally.
The implicit grid is not a bug in your layout. It is the layout, for everything you forgot to name a place for.
The one line that fixes most of it
grid-auto-rows: minmax(0, auto) is the line I add to
almost every grid I ship, and the line almost no tutorial mentions.
What it does not fix
Nothing about column overflow, which is a different problem
with a different answer — minmax(0, 1fr), for the same
underlying reason.
3comments
More updates
Three others, newest first.
The implicit grid explanation finally made this click for me. I had been declaring rows for years without knowing why it sometimes worked anyway.
That is exactly the trap — it works right up until the content count changes. Glad it helped.
Would love a follow-up on subgrid. It is the one part I still avoid.