liveBook · Manning

Column-gap

As explained in Web Design Playground, Second Edition

The CSS column-gap property specifies the horizontal space between columns in a layout container.

column-gap sets the horizontal space between columns in a layout container. In CSS Grid and Flexbox, that space is called a gutter—a small breathing room between items. section 13.5 section 12.2

Choose a standard CSS measurement unit for the gap:

A 15px gutter

Apply the property to the grid container: .container { display: grid; column-gap: 15px; row-gap: 20px; } The columns receive 15px of horizontal separation, while the rows receive 20px. section 13.5

container {
    display: grid;
    column-gap: col-gap-value;
    row-gap: row-gap-value;
}

Use column-gap and row-gap together on a grid container to control each direction independently. section 13.5

container {
    display: grid;
    gap: col-gap-value row-gap-value;
}

The gap shorthand can set column and row spacing in one declaration; its two values represent the column gap and row gap. section 13.5

How Web Design Playground, Second Edition covers it

How deep it goes
Defines syntax, units, gutters, examples, and gap shorthand without exploring layout internals.
Examples
Uses 15px column gaps, 20px row gaps, grid containers, and the gap shorthand.
What it assumes
Builds on knowing how to declare Grid or Flexbox containers and use standard CSS measurement units.
What you can do after
Apply column spacing through CSS declarations on Grid or Flexbox containers.
How it connects
Connects column-gap with CSS Grid, Flexbox, row-gap, gap, and gutters.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Web Design Playground, Second Edition. The section links point to the parts of the book it draws on.