Ever had a row of cards where the headers didn’t align because of text length? Subgrid solves the biggest headache in CSS Grid.
.container { display: grid; grid-template-rows: repeat(3, auto); }
.card {
display: grid;
grid-template-rows: subgrid;
grid-row: span 3;
}
This tells the card to inherit the row sizing of its parent, ensuring all headers, bodies, and footers align perfectly across the entire row.
