liveBook · Manning

Subgrid

Subgrid is a CSS Grid feature that lets a nested grid use and align with its parent grid's tracks for rows, columns, or both.

How 2 Manning books explain it

CSS in Depth, Second Edition

Subgrid is a CSS Grid feature that lets a nested grid use the grid lines of its parent grid for its rows, columns, or both.

How it is used
Aligns deeply nested card content across shared parent rows when ordinary parent-child layout cannot preserve consistent positions.
How deep it goes
Explains the alignment principle, builds an author-card layout, demonstrates named lines, and notes browser support without detailing rendering internals.
Examples
Uses three author cards whose headings, paragraphs, and Read More links align across shared rows.
What you can do after
Build it from scratch by nesting grids, spanning parent tracks, inheriting them with subgrid, and placing items on inherited or named lines.

Read how CSS in Depth, Second Edition explains subgrid →

Vanilla Web

Subgrid is a CSS Grid feature that lets a nested grid participate in the track sizing and alignment of its parent grid.

How it is used
Aligns nested grids across component boundaries without duplicating parent track definitions.
How deep it goes
Defines shared tracks, names both axis properties, and gives use cases, but stops short of a worked subgrid stylesheet.
Examples
Uses aligned card headers, bodies, and actions plus shared sidebar and main-content boundaries as use cases.
What you can do after
Apply it via `grid-template-columns: subgrid` or `grid-template-rows: subgrid` to align nested layouts with ancestor tracks.

Read how Vanilla Web explains subgrid →

Also covered in

What to know first

Related concepts

Questions about subgrid

What is subgrid?

Subgrid is a CSS Grid feature that lets a nested grid use and align with its parent grid's tracks for rows, columns, or both.

Which Manning books explain subgrid?

CSS in Depth, Second Edition and Vanilla Web.

What should I know before learning subgrid?

Manning books that teach subgrid usually introduce flexbox first.

These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.