CSS Portal

CSS grid-column Property

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!

Description

The grid-column property is the shorthand used on a grid item to control its horizontal placement within a grid container. It specifies the grid lines (or line names) that the item should start and end at on the column axis, which determines which columns the item occupies and how many columns it spans. While it changes an item’s position and the set of tracks the item covers, it does not itself define the sizes of those tracks — it only chooses which tracks are used.

Conceptually, grid-column maps directly to independent start and end placement properties: grid-column-start and grid-column-end. Those underlying properties represent the specific grid lines used for the leading and trailing edges of the item; the shorthand simply provides a compact way to set both in one declaration. Because it controls both sides of the occupied area, changing the shorthand can move an item, change how many columns it spans, or create overlaps with other items depending on other placement rules.

Placement set by grid-column interacts with how the grid is defined and how the automatic placement algorithm runs. The explicit column structure comes from grid-template-columns, and if placement refers to tracks outside that explicit grid, implicit tracks may be created whose sizing is governed by grid-auto-columns. If an item has no explicit column placement, the grid’s auto-placement behavior (grid-auto-flow) determines where it ends up. Note that alignment properties such as justify-self affect how the item’s content is positioned inside the area determined by grid-column, but they do not change which columns the item occupies.

Finally, when using named lines or allowing items to span multiple columns, grid-column is a key tool for creating complex layouts and intentional overlaps; changes to it will typically trigger layout reflow because they alter which tracks are occupied. It is used on grid items (children of the grid container) and is central to combining explicit placement with the grid’s track definitions and auto-placement behavior to achieve the desired horizontal layout.

Definition

Initial value
See individual properties
Applies to
Grid Items
Inherited
No
Computed value
See individual properties
Animatable
No
JavaScript syntax
object.style.gridColumn

Interactive Demo

One
Two
Three

Syntax

grid-column: grid-column-start | grid-column-end

Values

  • grid-column-startSpecifies on which column to start displaying the item.
  • grid-column-endSpecifies on which column-line to stop displaying the item, or how many columns to span.

Example

<div class='grid'>
<div class='item item-a'>Item A</div>
<div class='item item-b'>Item B
<br>
<small>grid-column: 2 / 4</small>
</div>
<div class='item item-c'>Item C</div>
<div class='item item-d'>Item D
<br>
<small>grid-column: span 2</small>
</div>
<div class='item item-e'>Item E
<br>
<small>grid-column: 1 / -1</small>
</div>
</div>
.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    align-items: center;
    max-width: 800px;
    margin: 20px auto;
}

.item {
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    padding: 16px;
    text-align: center;
    font-weight: 600;
    border-radius: 6px;
}

.item-b {
    grid-column: 2 / 4;
    background: #bfdbfe;
}

.item-d {
    grid-column: span 2;
    background: #bbf7d0;
}

.item-e {
    grid-column: 1 / -1;
    background: #ffe4b5;
}

small {
    display: block;
    font-weight: 400;
    font-size: 0.85em;
    margin-top: 6px;
    color: #374151;
}

Browser Support

The following information will show you the current browser support for the CSS grid-column property. Hover over a browser icon to see the version that first introduced support for this CSS property.

This property is supported by all modern browsers.
Desktop
Chrome
Edge
Firefox
Opera
Safari
Tablets & Mobile
Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-

Last updated by CSSPortal on: 1st January 2026

If this site has been useful, we’d love your support! Consider buying us a coffee to keep things going strong!