CSS grid-area Property

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

Definition and Usage

The grid-area property is a shorthand that places a grid item by setting its edges: grid-row-start, grid-column-start, grid-row-end, and grid-column-end.

You can assign a named area from grid-template-areas, or use line numbers and span. The property is not inherited. The initial value for each longhand is auto (auto-placement, span of 1).

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-area: <grid-line> [ / <grid-line> ]{0,3} | initial | inherit;

Four values mean row-start / column-start / row-end / column-end. One name means a named area.

Property Values

ValueDescriptionTry it
<custom-ident>Named area, such as header, matching grid-template-areasTry it
Four linesrow-start / column-start / row-end / column-endTry it
spanStretch across a number of tracks from the opposite edgeTry it
autoAuto-placement or default span of 1Try it
initialResets all four longhands to autoTry it
inheritTakes the parent’s grid-areaTry it

If you omit later values, missing ends often become auto, or copy a named start when that start is a custom ident.

How to Use grid-area

Build a grid container, then place each item with a name or with lines.

  1. Set display: grid on the container.
  2. For named placement, define areas with grid-template-areas.
  3. On the item, set grid-area to the area name, or to line values.
  4. Use longhands such as grid-row or grid-column when you only need one axis.
PieceRequired?Role
Grid containerYesdisplay: grid on the parent
Named areas or tracksFor named / line placementgrid-template-areas or numbered lines
grid-area on the itemYesChooses the region the item occupies

Live Preview

A layout with named areas a, b, and c. Only the highlighted item’s grid-area changes.

Purple tile is the item. Gray labels show the named template areas.

Sample
Item

grid-area: a

CSS Examples

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

Example 1 — Named Area

Place the item into a region defined on the container.

CSS
<style>
  section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "header header"
      "main side";
  }

  .box {
    grid-area: header;
  }
</style>

<section>
  <div class="box">Header</div>
  <div>Main</div>
  <div>Side</div>
</section>
Try It Yourself

How It Works

  1. Draw the map. grid-template-areas names a full-width header row and a main / side row.
  2. Assign the item. grid-area: header puts that item into every cell labeled header.
  3. Fill the rest. The other children auto-place into the remaining cells.
  4. Match the spelling. The name in grid-area must match the word in the template.

Example 2 — Line Numbers

Pin the item with row and column start and end lines.

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

  .box {
    grid-area: 1 / 1 / 2 / 4;
  }
</style>

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

How It Works

  1. Count lines, not tracks. A 3×3 grid has 4 column lines and 4 row lines.
  2. Read the four values. 1 / 1 / 2 / 4 means row start 1, column start 1, row end 2, column end 4.
  3. See the span. The item covers the whole first row (three columns).
  4. Order tip. Rows first, then columns: start, then end.

Example 3 — Span Tracks

Start at a line, then stretch a set number of tracks.

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

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

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

How It Works

  1. Pick the start. 1 / 1 starts at the first row and first column lines.
  2. Span rows. span 2 for the row end covers two row tracks.
  3. Span columns. span 2 for the column end covers two column tracks.
  4. Result. The item fills a 2×2 block in the top-left corner.

Edge Cases & Pitfalls

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

target

Set it on the item, not the container

grid-area places children. The container uses grid-template-areas or track properties instead.

name

Named areas must match

grid-area: header only works if the template includes the word header. A typo falls back to line-based rules and can look random.

order

Four values are row / column / row / column

People often swap axes. Memorize: row-start / column-start / row-end / column-end.

lines

Lines are one more than tracks

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

auto

auto means auto-placement

With auto, the item takes the next free cell according to grid-auto-flow. It does not stick to a named area.

Browser Support

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

✓ Baseline · Widely available

grid-area

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-area
Not supported
grid-area Widely supported

Bottom line: Safe in current browsers. Pair named areas with grid-template-areas, or use line numbers and span for precise placement.

Key Takeaways

  • Role: place a grid item with a name or with row/column lines.
  • Order: row-start / column-start / row-end / column-end.
  • On the item. The container defines areas; the item claims one.
  • Initial: all longhands are auto.

One line: grid-area is how a grid item claims a named region or a line-based box.

Frequently Asked Questions

It places and sizes a grid item by setting its row and column start and end lines, or by assigning it to a named area from grid-template-areas.
Each longhand starts as auto, so the item uses auto-placement and a default span of 1.
row-start / column-start / row-end / column-end. Remember: rows first, then columns, start before end.
grid-template-areas names regions on the container. grid-area on an item assigns that item to a named region, or sets line-based placement instead.
Yes. For example, grid-area: 1 / 1 / span 2 / span 3 starts at row 1 and column 1, then spans two rows and three columns.
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-auto-columns

Size columns created by auto-placement.

grid-auto-columns tutorial →

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