grid

grid-column

Shorthand for grid-column-start and grid-column-end, controlling how many columns a grid item spans. Accepts line numbers, named lines, or span keywords.

grid-column: <start> / <end> (e.g. 1 / 3 | span 2 | 2 / -1)

Common values

Value Effect
1 / -1 Spans from first to last column line
span 2 Item covers two columns from its auto position
2 / 4 Starts at line 2, ends at line 4
auto Default; auto-placed by grid

Examples

.hero { grid-column: 1 / -1; }

Full-width row inside a grid

.wide { grid-column: span 2; }

Card takes two column tracks

.sidebar { grid-column: 1; grid-row: 1 / span 3; }

Sidebar in column one spanning three rows

Gotcha

Negative line numbers count from the end of the explicit grid only; implicit tracks are not reachable that way.

Related properties

← All CSS properties · CSS selectors · Grid vs Flexbox