Subgrid lets a nested grid position its rows, columns, or both on the grid lines of its parent. This solves alignment problems that span multiple levels of markup. section 5.5 section 5.7
Aligning author cards
A three-column author-card layout can align each heading, paragraph, and Read More link across every card. Make each card a grid, let it span three parent rows, and inherit those rows with grid-template-rows: subgrid. Short headings then receive space above them, paragraphs begin at the same height, and links align along the bottom.
Subgrid also supports these placement techniques:
- Inherited line numbers, line names, and area names can place items within the subgrid; grid-row: 2 places every card title on the second row. section 5.5.1
- Additional line names can be assigned after the subgrid keyword, such as subgrid [line1] [line2] [line3] [line4]. section 5.5.1
- Use browser grid debugging tools to inspect lines and gaps; support is newer and varies by browser. section 5.5
