grid-column-end

W3C CSS Snapshot 2026

Set the end line for a grid item along its columns.

On this page

Syntax and values

Value or syntaxWhat it does
autoLets the browser resolve this edge using auto-placement or the default span.
3Uses an explicit grid line. Negative numbers count backward from the end of the explicit grid.
span 2Spans two tracks from the opposite edge when that edge is known.
contentUses a named grid line or the matching edge of an area named content.

Try the example

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>grid-column-end example</title>
  <style>
.layout { display: grid; width: min(100%, 320px); border: 2px solid teal; box-sizing: border-box; }
.layout > div { padding: 8px 12px; background: #def5f5; color: #123; border: 1px solid #81b9b5; box-sizing: border-box; }
.layout { grid-template-columns: 1fr 1fr; grid-template-rows: 60px 60px; }
.layout .first { grid-column-start: 1; grid-column-end: 3; }
  </style>
</head>
<body>
<div class="layout">
  <div class="first">A</div>
  <div class="second">B</div>
  <div>C</div>
</div>
</body>
</html>

What to expect A spans two tracks. Try changing this edge by one line to make it span one track.

Official references