subgrid
A CSS Grid value that lets a nested grid use its parent grid's tracks instead of sizing its own, so content in separate cards lines up.
In more detail
Without it, each card sizes its header, body and footer rows alone and they misalign. With grid-template-rows: subgrid and a matching row span, all cards share the parent's rows, so every footer sits on the same line. Subgrid can apply to rows, columns or both.
Related terms
- CSS Grid — A CSS layout mode that places a container's children into rows and columns.
- grid track — One row or one column of a CSS grid, the space between two neighbouring grid lines.
- grid-row — The CSS Grid properties that set which rows or columns an item occupies, such as grid-row: span 3 to cover three rows.
- progressive enhancement — Building a page that works everywhere first, then adding better features for browsers that support them.
Taught in
- MutationObserver: Reactive DOM Watching Without Polling — Frontend Architecture & Web Platform
- CSS Subgrid: Inheriting Track Sizing Across Nested Layouts — Frontend Architecture & Web Platform