22Jul

The grid lesson nobody asked for

Why the implicit grid is where every layout question actually starts.

4 min read · Sent to 9.2k readers

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

Markdown works. Be kind.
  1. MR
    Maya Rodriguez 2 days ago

    The implicit grid explanation finally made this click for me. I had been declaring rows for years without knowing why it sometimes worked anyway.

    1. SS
      Swarnil Singhai 2 days ago

      That is exactly the trap — it works right up until the content count changes. Glad it helped.

  2. DK
    Dan K. 5 days ago

    Would love a follow-up on subgrid. It is the one part I still avoid.