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 counts and widths for CSS Grid layouts, including a centered portfolio-page container.
How deep it goes
Explains space-separated sizing values and works through fixed-width and fractional columns, without descending into browser layout internals.
Examples
Shows a three-column grid sized 100px, 200px, and 300px, plus a portfolio layout using `1fr auto 1fr`.
What you can do after
Build it from scratch: specify grid-column widths and center page content in an automatically sized middle column.

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 →

Also covered in

What to know first

Related concepts

Questions about grid-template-columns

What is grid-template-columns?

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

Which Manning books explain grid-template-columns?

Web Design Playground, Second Edition, CSS in Depth, Second Edition, Tiny CSS Projects and Build a Website with ChatGPT.

What should I know before learning grid-template-columns?

Manning books that teach grid-template-columns usually introduce flexbox and CSS Grid first.

What is grid-template-columns part of?

Grid-template-columns is part of grid template. A grid template is a specification of the number and dimensions of columns and rows in a grid layout.

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.