liveBook · Manning

Grid-template-columns

The CSS grid-template-columns property defines the sizes and optional names of a grid’s column tracks and grid lines.

How 4 Manning books explain it

Web Design Playground, Second Edition

The CSS grid-template-columns property specifies the number, sizes, and track definitions of a grid's columns.

How it is used
Defines column tracks for grid containers, including a centered overall page layout.
How deep it goes
Explains track-value syntax, units, keywords, automatic rows, and a practical fractional-column layout.
Examples
Uses fixed three-column tracks and a `1fr auto 1fr` body grid that centers a nested content container.
What you can do after
Apply it to define fixed, automatic, or fractional grid columns and center content with a three-column layout.

Read how Web Design Playground, Second Edition explains grid-template-columns →

CSS in Depth, Second Edition

The CSS grid-template-columns property defines the sizes and optional names of a grid container's column tracks and grid lines.

How it is used
Defines column widths and lines for grid layouts, from equal-sized boxes to a main-content-and-sidebar page.
How deep it goes
Works through fraction-based sizing, mixed widths, named lines, repeated patterns, and parent-line inheritance with subgrid.
Examples
Uses a six-item grid, a main-content-and-sidebar page, and repeated named column lines.
What you can do after
Build it from scratch: size grid columns and name their boundaries for item placement.

Read how CSS in Depth, Second Edition explains grid-template-columns →

Tiny CSS Projects

The CSS grid-template-columns property defines the sizes and number of columns in a grid.

How it is used
Defines the number and sizes of columns on a grid container.
How deep it goes
Works through track lists, repeated columns, minimum widths, and fractional sizing without detailing browser layout algorithms.
Examples
Uses a three-column `main` layout and equal-versus-unequal `fr` shares to demonstrate track sizing.
What you can do after
Build it from scratch: define fixed and flexible columns on a CSS Grid container.

Read how Tiny CSS Projects explains grid-template-columns →

Build a Website with ChatGPT

The CSS grid-template-columns property defines the number and widths of columns in a grid container.

How it is used
Uses CSS Grid to place article and aside content in proportionally sized columns.
How deep it goes
Explains fractional units and editable ratios, while deferring complete small-screen responsiveness.
Examples
Demonstrates article-and-aside layouts using 2fr 1fr, 3fr 1fr, and 1fr 2fr.
What you can do after
Apply it via CSS to create and customize a two-column article layout.

Read how Build a Website with ChatGPT explains grid-template-columns →

Related concepts

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.