liveBook · Manning

Gap

The CSS gap property specifies the spacing between rows and columns or between items in a layout container.

How 2 Manning books explain it

Tiny CSS Projects

The CSS gap property is a shorthand property that sets the spacing between rows and columns in a grid or other layout.

How it is used
Adds consistent space between grid tracks or flex items in cards, description lists, buttons, and responsive layouts.
How deep it goes
Defines the shorthand, value order, defaults, and outer-edge behavior, then applies it in grid and flex examples.
Examples
Uses 20-pixel grid gutters, one-rem card spacing, 12-pixel profile-statistic spacing, and a one-character button icon gap.
What you can do after
Apply it via CSS to space grid or flex contents without adding space at the container’s outer edges.

Read how Tiny CSS Projects explains gap →

CSS in Depth, Second Edition

The CSS gap property specifies the spacing between rows and columns in layout containers such as flex and grid containers.

How it is used
Spaces flex and grid items while keeping the layout container responsible for consistent gutters.
How deep it goes
Explains single- and two-value spacing, unit choices, reuse, and interaction with margins, without descending into browser layout internals.
Examples
Demonstrates navigation menus, responsive navbar spacing, flex tile rows, and a six-item grid.
What you can do after
Apply it in CSS to build consistent gutters in flex and grid layouts and choose suitable spacing units.

Read how CSS in Depth, Second Edition explains gap →

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.