Subgrid for Aligned Nested Content
Use subgrid to align nested grid items to the parent grid's tracks.
The Subgrid Problem
A common challenge: you have a grid of cards, each with a header, body, and footer. Without subgrid, items in different cards cannot align to the same baselines because each card is its own independent layout.
What is Subgrid?
subgrid is a value for grid-template-columns or grid-template-rows that makes a nested grid inherit and participate in the parent grid's track definitions.
All lessons in this course
- Named Lines and Named Grid Areas
- Auto-fit and Auto-fill with minmax
- Implicit Grid and Grid-Auto-Flow
- Subgrid for Aligned Nested Content