Grid container
A grid container is an element whose display mode establishes a CSS Grid formatting context for laying out its child elements as grid items.
CSS in Depth, Second Edition
A grid container is an element whose display mode establishes a CSS Grid formatting context for its child elements.
- How it is used
- Uses a grid container to arrange direct children in page layouts, portfolios, cards, and responsive columns.
- How deep it goes
- Develops templates, implicit tracks, alignment, and nested subgrid through rendered layouts rather than browser internals.
- Examples
- Builds a six-box grid, a main-and-sidebar page, an expanding photo portfolio, and responsive three-column content.
- What you can do after
- Build it from scratch: define a grid container, size its tracks, and let additional items create rows when needed.
Read how CSS in Depth, Second Edition explains grid container →
Web Design Playground, Second Edition
A grid container is an element whose child elements are laid out according to CSS Grid rules.
- How it is used
- Provides the parent element that arranges child grid items across rows and columns.
- How deep it goes
- Works from the display declaration through track sizing, gaps, and alignment, with a visible one-column starting result.
- Examples
- Shows a div with six child divs, then uses the body element to center portfolio content.
- What you can do after
- Build it from scratch by declaring a grid container, sizing its columns, and placing content in a chosen column.
Read how Web Design Playground, Second Edition explains grid container →
Also covered in
What to know first
- normal flowNormal flow is the browser’s ordinary layout process, arranging elements according to document order and their formatting behavior without out-of-flow positioning.
Related concepts
- grid itemhas part · A grid item is a child of a CSS Grid container that participates in its two-dimensional grid layout.
- algebraic structurekind of · An algebraic structure is a set of elements equipped with operations and laws governing those operations.
- declarationconfigured by · A CSS declaration is a property-value pair that specifies one styling instruction.
- display propertyconfigured by · The CSS property that specifies how an element generates boxes and participates in layout.
- grid-template-columnsconfigured by · The CSS grid-template-columns property defines the sizes and optional names of a grid’s column tracks and grid lines.
- grid-template-rowsconfigured by · The CSS grid-template-rows property defines the number, sizes, and track structure of a grid's rows.
Questions about grid container
What is grid container?
A grid container is an element whose display mode establishes a CSS Grid formatting context for laying out its child elements as grid items.
Which Manning books explain grid container?
CSS in Depth, Second Edition and Web Design Playground, Second Edition.
What should I know before learning grid container?
Manning books that teach grid container usually introduce normal flow first.
What is grid container a kind of?
Grid container is a kind of algebraic structure. An algebraic structure is a set of elements equipped with operations and laws governing those operations.
What are the parts of grid container?
Grid container includes grid item.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

