CSS Grid container
Defines an element as a grid container and establishes a new grid formatting context for its direct children.
What it does: Combining repeat with the fr unit allocates equivalent sizing blocks efficiently. grid-template-rows measures explicit layout sizes vertically for stacking row bands. display: grid is the standard value that makes an element a block-level grid layout container. Track listings are space-separated lists in CSS Grid, like 1fr 200px 1fr. The gap property replaces older grid-gap properties and styles uniform layout gutters. The fr unit calculates layout fraction distributions dynamically across track spaces. repeat(3, 1fr) simplifies your markup by generating three identical track values automatically. display: grid establishes a structured multi-dimensional coordinate space for nested nodes.
Common mistakes: The selector is missing a class dot prefix or tag definition. To target a class named grid-container, use .grid-container. The value true-grid is invalid. To activate the layout context, use display: grid.
Free printable worksheet with full answer key — or add this module to a journey and assign it to your class.
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
display: gridFill in the Blanks
Spot the Error
Create a free class, add this module to a journey, and track who's stuck.
Create a free teacher account →No credit card. No setup fee. Make a class and invite students in under three minutes.
Practice this topic interactively, track progress, and unlock badges.
Start Learning Free →