grid-column
A shorthand property for grid-column-start and grid-column-end. It defines an item's horizontal position and width within a grid in a single line.
Quick example
.feature-box {
grid-column: 1 / 3;
}
.full-width {
grid-column: 1 / -1;
} /* spans across all columns */ Syntax
grid-column: <grid-line> [/ <grid-line>]?<integer><line-number> / <line-number>span <number><line-number> / span <number>1 / -1<name>autoQuick facts
See individual propertiesExamples
Full-width row across the grid
.hero {
grid-column: 1 / -1;
} Spans from the first column line to the last. Works regardless of how many columns the grid has, so your layout stays flexible.
Span multiple columns
.feature-card {
grid-column: span 2;
} Takes up two columns wherever auto-placement puts it. No need to specify the starting line.
Exact start and end
.sidebar {
grid-column: 1 / 2;
}
.main {
grid-column: 2 / 5;
} Sidebar occupies column 1 only. Main occupies columns 2 through 4 (line 2 to line 5 spans three columns).
grid-column Browser Support
This feature is well established and works across many devices and browser versions. It has been available across browsers since 2017.
Safe to use without fallbacks.
Common pitfalls
In a 4-column grid, there are 5 column lines. grid-column: 1 / 3 spans two columns (from line 1 to line 3), not three. This off-by-one is the most common grid error.
Negative line numbers count from the end of the explicit grid (defined in grid-template-columns). In an implicit grid created by auto-flow, -1 may not point where you expect. Use an explicit grid-template-columns if you rely on -1.
grid-column: span 5 in a 3-column grid either makes the item start on a new row where 5 tracks fit (which may still fall short), or creates implicit column tracks. Behavior depends on grid-auto-flow. Verify by testing how the grid grows when content exceeds expected size.