CSS grid-column-end Property

Beginner
⏱️ 6 min read
📚 Updated: Jun 2026
🎯 4 Examples
Layout

What You’ll Learn

The grid-column-end property sets where a grid item stops on the column axis, controlling how many columns it spans.

01

End line

Stop column.

02

auto

Default end.

03

span 3

Column count.

04

Line #

Exact stop.

05

With start

Pair lines.

06

Grid item

Child element.

Introduction

The grid-column-end property in CSS is used in grid layouts to determine where a grid item ends on the column axis. It specifies the line where the item should stop, allowing for flexible and complex grid designs.

This property is crucial for placing and spanning elements across multiple columns in a grid container.

Definition and Usage

Apply grid-column-end on a child of a grid container. Use it alone with span n to stretch an item across multiple columns from its auto-placed start. Pair it with grid-column-start when you need both the starting and ending column lines defined separately.

💡
Beginner Tip

grid-column-end: span 3 means the item covers three column tracks. You can also use a line number like grid-column-end: 4 to stop at column line 4.

📝 Syntax

The syntax for the grid-column-end property is straightforward. It can be applied to any grid item within a grid container:

syntax.css
element {
  grid-column-end: value;
}

Basic Example

grid-column-end-basic.css
.item2 {
  grid-column-end: span 3;
}

With grid-column-start

grid-column-end-with-start.css
.featured {
  grid-column-start: 2;
  grid-column-end: 5;
}
grid-column-end: span 3; grid-column-end: 4; grid-column-end: -1;

Default Value

The default value of the grid-column-end property is auto, which means the grid item will span only one column and end at the next column line.

Syntax Rules

  • Applies to grid items (children of a grid container), not the container itself.
  • Accepts line numbers, span n, named lines, and auto.
  • Works with grid-column-start; together they form the grid-column shorthand.
  • The property is not inherited.
  • Negative line numbers count from the end of the grid.

⚡ Quick Reference

QuestionAnswer
Initial valueauto
Applies toGrid items
InheritedNo
ControlsEnding column line
Shorthand partnergrid-column-start

💎 Property Values

ValueDescription
autoThe item will end at the next grid column line
span <number>The item will span across the specified number of columns
<line>The item will end at the specified grid line number
<name>The item will end at the named grid line

👀 Live Preview

Item 2 spans three columns with grid-column-end: span 3 (highlighted):

1
2
3
4

Examples Gallery

Span columns with span, set an exact ending line, and combine start and end for precise placement.

🔢 Column End Placement

Start with the reference example — an item spanning three columns.

Example 1 — span 3 Columns

Make an item span three columns using the span keyword on the end property.

grid-column-end-span.css
.item2 {
  grid-column-end: span 3;
}
Try It Yourself

How It Works

From its auto-placed starting column, item 2 extends across three column tracks because grid-column-end: span 3 sets the ending position three columns later.

Example 2 — End at Line 4

Stop an item at a specific column line number.

grid-column-end-line.css
.wide {
  grid-column-start: 1;
  grid-column-end: 4;
}
Try It Yourself

How It Works

Starting at line 1 and ending at line 4 covers three column tracks (columns 1, 2, and 3).

📈 Precise Placement

Combine start and end lines for exact column boundaries.

Example 3 — Featured Block from Column 2 to 5

Place a featured section between specific column lines.

grid-column-end-featured.css
.featured {
  grid-column-start: 2;
  grid-column-end: 5;
}
Try It Yourself

How It Works

The featured block starts at column line 2 and ends at line 5, spanning columns 2, 3, and 4.

Example 4 — End at the Last Column Line

Use a negative line number to stretch an item to the grid edge.

grid-column-end-negative.css
.stretch {
  grid-column-start: 2;
  grid-column-end: -1;
}
Try It Yourself

How It Works

-1 refers to the last column line. Combined with grid-column-start: 2, the item fills from column 2 through the final column.

♿ Accessibility

  • Keep DOM order meaningful when spanning changes visual reading flow.
  • Do not rely on column span alone to convey relationships; use headings and labels.
  • Test keyboard tab order when wide items reorder the visual layout.
  • Use semantic elements such as <main> alongside grid placement.
  • Verify content remains readable when items span many columns on small screens.

🧠 How grid-column-end Works

1

Item gets a start position

Auto-placement or grid-column-start sets where the item begins.

Start
2

grid-column-end is set

You define the ending line or span with span n or a line number.

End
3

Browser spans columns

The item stretches horizontally from start to end across column tracks.

Span
=

Controlled column width

The item covers exactly the columns defined by its ending line.

🖥 Browser Compatibility

The grid-column-end property is supported in all modern browsers, including recent versions of Chrome, Firefox, Safari, Edge, and Opera.

Baseline · Modern browsers

grid-column-end everywhere

Column end placement works in all major modern grid implementations.

97% Modern browser support
Google Chrome 57+ · Desktop & Mobile
Full support
Mozilla Firefox 52+ · Desktop & Mobile
Full support
Apple Safari 10.1+ · macOS & iOS
Full support
Microsoft Edge 16+ · 79+ Chromium
Full support
Opera 44+
Full support
grid-column-end property 97% supported

Bottom line: Safe for modern projects. Test spanning layouts across browsers for consistent rendering.

🎉 Conclusion

The grid-column-end property is an essential part of CSS Grid Layout, allowing developers to control the placement and span of grid items on the column axis. By mastering this property, you can create flexible and sophisticated grid-based designs.

Experiment with different values and combinations to see how this property can enhance your layout designs. Start with span, then pair with grid-column-start for precise boundaries.

💡 Best Practices

✅ Do

  • Use span n for flexible column counts
  • Pair with grid-column-start for exact placement
  • Use negative lines to reach the grid edge
  • Prefer grid-column shorthand when setting both sides
  • Test responsive behavior at smaller widths

❌ Don’t

  • Apply on grid containers instead of items
  • Confuse line numbers with column count
  • Forget that line numbering starts at 1
  • Break reading order without testing a11y
  • Mix conflicting start and end values carelessly

Key Takeaways

Knowledge Unlocked

Five things to remember about grid-column-end

Use these points when setting the ending column line.

5
Core concepts
auto 02

Default auto

One column.

Default
span 03

span 3

Three cols.

Syntax
4 04

Line number

Exact stop.

Pattern
start 05

With start

Pair lines.

Workflow

❓ Frequently Asked Questions

grid-column-end sets the column line where a grid item stops, controlling how far the item extends horizontally across columns.
The default is auto, which means the item spans one column and ends at the next column line from its starting position.
grid-column-end sets only the ending column line. grid-column is shorthand for both grid-column-start and grid-column-end.
The item spans three columns from its starting column line, ending three tracks later.
Yes. Negative numbers count from the end of the grid. For example, grid-column-end: -1 ends at the last column line.

Practice in the Live Editor

Open the HTML editor, change grid-column-end values, and watch items span different column widths.

HTML Editor →

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.

5 people found this page helpful