CSS Grid container
Defines an element as a grid container and establishes a new grid formatting context for its direct children.
Understanding CSS Grid container in HTML & CSS
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 class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 53–63) and word search (Modules 43–63).
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
Student with a class code? Join your class →