CSS grid-column Property

Beginner
5 min read
Updated: Oct 2026
3 examples
Live preview

Definition and Usage

The grid-column property is a shorthand that places a grid item horizontally by setting grid-column-start and grid-column-end.

Use line numbers, named lines, or span. One value often sets the start (and may imply a named area end). Two values use a slash: start / end. The property is not inherited. The initial value for each longhand is auto. For both axes in one declaration, see grid-area.

Standard-track.

Not deprecated and not experimental. Baseline Widely available since 2017. Set it on the item, not on the grid container.

CSS Syntax

syntax.css
grid-column: <grid-line> [ / <grid-line> ]? | initial | inherit;

Common forms: 1 / 3, span 2, and 2 / -1 (from line 2 to the last line).

Property Values

ValueDescriptionTry it
start / endColumn line numbers, such as 1 / 3Try it
spanStretch across a number of columns, such as span 2Try it
Negative endCount from the end, such as 1 / -1 for full widthTry it
autoAuto-placement or default span of 1Try it
initialResets both longhands to autoTry it
inheritTakes the parent’s grid-columnTry it

Lines are numbered from 1. A 3-column grid has column lines 1–4. Negative numbers count backward from the end.

How to Use grid-column

Build a grid with columns, then place an item on those column lines.

  1. Set display: grid and define columns with grid-template-columns.
  2. On the item, set grid-column to start / end or span n.
  3. Use grid-row when you also need vertical placement.
  4. Prefer longhands when you only change the start or only the end.
PieceRequired?Role
Grid containerYesdisplay: grid on the parent
Column tracksYesUsually from grid-template-columns
grid-column on the itemYesChooses which columns the item occupies

Live Preview

A three-column grid. Only the highlighted item’s grid-column changes.

Purple tile is the item. Gray cells show the three column tracks.

Sample
Item
A
B
C

grid-column: 1 / 3

CSS Examples

Each snippet focuses on grid-column. Use Try It Yourself for a live editor.

Example 1 — Start and End Lines

Pin the item between two column lines.

CSS
<style>
  section {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
  }

  .box {
    grid-column: 1 / 3;
  }
</style>

<section>
  <div class="box">Wide</div>
  <div>2</div>
  <div>3</div>
</section>
Try It Yourself

How It Works

  1. Make three columns. That creates column lines 1, 2, 3, and 4.
  2. Set the start. 1 before the slash is grid-column-start.
  3. Set the end. 3 after the slash is grid-column-end.
  4. See the span. Lines 1 to 3 cover the first two tracks.

Example 2 — Span Columns

Stretch across two columns from the item’s start position.

CSS
<style>
  section {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
  }

  .box {
    grid-column: span 2;
  }
</style>

<section>
  <div class="box">Span</div>
  <div>2</div>
  <div>3</div>
</section>
Try It Yourself

How It Works

  1. Keep the start auto. The item begins at the next free cell (usually line 1).
  2. Span two tracks. span 2 sets the end two columns away.
  3. Same idea as lines. From auto start at 1, this matches covering columns 1 and 2.
  4. Combine forms. You can also write 2 / span 2 to start at line 2 and span two tracks.

Example 3 — Stretch to the Last Line

Use a negative line number to reach the end of the explicit grid.

CSS
<style>
  section {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
  }

  .box {
    grid-column: 1 / -1;
  }
</style>

<section>
  <div class="box">Full</div>
  <div>2</div>
  <div>3</div>
  <div>4</div>
</section>
Try It Yourself

How It Works

  1. Start at the first line. 1 is the left edge of the grid.
  2. End at the last line. -1 means the final column line of the explicit grid.
  3. Cover every column. On a 3-column grid, that spans all three tracks.
  4. Handy for headers. Full-width banners often use 1 / -1.

Edge Cases & Pitfalls

If the item sits in the wrong columns, check these first.

target

Set it on the item, not the container

grid-column places children. The container defines tracks with grid-template-columns.

lines

Lines are one more than tracks

Three columns mean lines 1–4. Ending at line 4 spans all three columns from line 1.

slash

Start comes before the slash

1 / 3 is start then end. Swapping them can invert or invalidate the placement.

row

This property does not set the row

Use grid-row or grid-area when you need vertical placement too.

auto

auto follows auto-placement

With auto, the item takes the next free cell according to grid-auto-flow.

Browser Support

grid-column is a browser CSS property for Grid item placement. Node.js, Deno, and Bun do not apply it.

✓ Baseline · Widely available

grid-column

Supported in Chrome 57+, Firefox 52+, Safari 10.1+, and Edge 16+. Internet Explorer does not support the modern property.

97% Global support
Google Chrome 57+
Full support
Mozilla Firefox 52+
Full support
Apple Safari 10.1+
Full support
Microsoft Edge 16+
Full support
Opera 44+
Full support
Samsung Internet 6.2+
Full support
Internet Explorer No modern grid-column
Not supported
grid-column Widely supported

Bottom line: Safe in current browsers. Use line numbers or span for clear column placement; pair with grid-row when needed.

Key Takeaways

  • Role: place a grid item across columns with start/end lines or span.
  • Shorthand for grid-column-start and grid-column-end.
  • On the item. The container defines the column tracks.
  • Tip: 1 / -1 spans the full explicit grid width.

One line: grid-column is how a grid item claims its horizontal track range.

Frequently Asked Questions

It is a shorthand that sets a grid item’s horizontal placement by defining grid-column-start and grid-column-end with line numbers, names, or span.
Both longhands start as auto, so the item uses auto-placement and a default span of 1.
The item starts at column line 1 and ends at column line 3, so it spans two column tracks.
The item stretches across two columns from its start line (auto-placed or set). It is shorthand for spanning two tracks.
grid-column controls columns only. grid-area can set both row and column edges, or assign a named area from grid-template-areas.
It is Baseline Widely available: Chrome 57+, Firefox 52+, Safari 10.1+, and Edge 16+. Internet Explorer does not support the modern property. It is a browser CSS property, not a Node.js feature.

Next: grid-column-end

Set only the ending column line of an item.

grid-column-end tutorial →

CODETOFUN NEWS

Stay Ahead in Tech

Get the latest IT news, programming updates, and technology trends directly on your phone.

Your daily dose of tech, straight to your feed.

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful