Learn CSS Subgrid for Perfect Alignment

Coding2GO on YouTubeWatch on YouTube

SaveMark complete

Sign in to save videos and track what you’ve finished.

IntermediateWeb Development4 min

About this video

Shows how CSS subgrid lets child elements inherit a parent grid's rows or columns, so buttons and text blocks in cards line up even when their content lengths differ. Covers setting grid-template-rows and grid-template-columns to subgrid for responsive card layouts.

What you’ll learn

  • Align buttons and text blocks across cards with grid-template-rows: subgrid
  • Use grid-template-columns: subgrid so child elements share the parent's column tracks
  • Remove wrappers and manual height hacks from responsive card layouts