The grid-column property lets you control how many columns a grid item spans and where it starts and ends horizontally.
01
Span cols
Width control.
02
1 / 3
Line numbers.
03
span 2
Column count.
04
Shorthand
Start & end.
05
auto
Default flow.
06
Grid item
Child element.
Fundamentals
Introduction
The grid-column property in CSS is used in the context of CSS Grid Layout. It allows you to define how many columns an element should span within a grid container, and which columns it should start and end at.
This property simplifies the process of positioning elements within a grid, making layout design more flexible and efficient.
Definition and Usage
Apply grid-column on a child of a grid container (an element with display: grid). Use line numbers like 1 / 3 when you need precise placement. Use span 2 when you only care how many columns an item should cover.
💡
Beginner Tip
Grid column lines are numbered starting at 1. So grid-column: 1 / 3 spans from line 1 to line 3, covering two column tracks.
Foundation
📝 Syntax
The grid-column property can be defined using two different syntax formats: the shorthand syntax and the longhand syntax.
Shorthand Syntax
syntax-shorthand.css
element{grid-column:start/end;}
start — The starting grid line for the column.
end — The ending grid line for the column.
Longhand Syntax
The grid-column property can also be set using the longhand properties grid-column-start and grid-column-end:
The sidebar occupies column 1. Main content spans columns 2 and 3 using lines 2 and 4.
A11y
♿ Accessibility
Keep DOM order logical even when visual column placement changes reading flow.
Do not rely on column position alone to convey meaning; use headings and labels.
Test keyboard tab order when spanning items reorder the visual layout.
Ensure full-width banners do not skip important navigation for screen reader users.
Use semantic HTML such as <main> and <aside> alongside grid placement.
🧠 How grid-column Works
1
Grid columns are defined
grid-template-columns creates column tracks on the container.
Template
2
Item gets grid-column
You set start and end lines or a span on a grid item.
Placement
3
Browser spans columns
The item stretches across the specified column tracks horizontally.
Span
=
▦
Precise horizontal layout
Items cover exactly the columns you need for banners, heroes, and sidebars.
Compatibility
🖥 Browser Compatibility
The grid-column property is widely supported in modern browsers, including recent versions of Chrome, Firefox, Safari, Edge, and Opera.
✓ Baseline · Modern browsers
grid-column everywhere
Column placement works in all major modern grid implementations.
97%Modern browser support
Google Chrome57+ · Desktop & Mobile
Full support
Mozilla Firefox52+ · Desktop & Mobile
Full support
Apple Safari10.1+ · macOS & iOS
Full support
Microsoft Edge16+ · 79+ Chromium
Full support
Opera44+
Full support
grid-column property97% supported
Bottom line: Safe for modern projects. Test spanning layouts across browsers for consistent rendering.
Wrap Up
🎉 Conclusion
The grid-column property is a powerful feature of CSS Grid Layout that provides precise control over the placement of elements within a grid. By defining the start and end positions of an element, you can create complex and responsive layouts with ease.
Experiment with different grid configurations to see how this property can enhance your web designs. Start with line numbers, then try span and 1 / -1 for common layout patterns.