Home CSS Properties grid-area CSS grid-area Property Definition
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.
Syntax
CSS Syntax 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.
Values
Property Values Value Description Try it <custom-ident>Named area, such as header, matching grid-template-areas Try itFour lines row-start / column-start / row-end / column-end Try itspanStretch across a number of tracks from the opposite edge Try itautoAuto-placement or default span of 1 Try itinitialResets all four longhands to auto Try itinheritTakes the parent’s grid-area Try it
If you omit later values, missing ends often become auto, or copy a named start when that start is a custom ident.
Approach
How to Use grid-area Build a grid container, then place each item with a name or with lines.
Set display: grid on the container. For named placement, define areas with grid-template-areas . On the item, set grid-area to the area name, or to line values. Use longhands such as grid-row or grid-column when you only need one axis. Piece Required? Role Grid container Yes display: grid on the parentNamed areas or tracks For named / line placement grid-template-areas or numbered linesgrid-area on the itemYes Chooses the region the item occupies
Try it
Live Preview A layout with named areas a, b, and c. Only the highlighted item’s grid-area changes.
Code
CSS Examples Each snippet focuses on grid-area. Use Try It Yourself for a live editor.
1. Named area 2. Line numbers 3. Span Example 1 — Named Area Place the item into a region defined on the container.
<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> How It Works Draw the map. grid-template-areas names a full-width header row and a main / side row.Assign the item. grid-area: header puts that item into every cell labeled header.Fill the rest. The other children auto-place into the remaining cells.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.
<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> How It Works Count lines, not tracks. A 3×3 grid has 4 column lines and 4 row lines.Read the four values. 1 / 1 / 2 / 4 means row start 1, column start 1, row end 2, column end 4.See the span. The item covers the whole first row (three columns).Order tip. Rows first, then columns: start, then end.Example 3 — Span Tracks Start at a line, then stretch a set number of tracks.
<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> How It Works Pick the start. 1 / 1 starts at the first row and first column lines.Span rows. span 2 for the row end covers two row tracks.Span columns. span 2 for the column end covers two column tracks.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-placementWith auto, the item takes the next free cell according to grid-auto-flow . It does not stick to a named area.
Compatibility
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.
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.
Remember
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 What does the CSS grid-area property do? 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.
What is the default value of grid-area? Each longhand starts as auto, so the item uses auto-placement and a default span of 1.
What is the order of the four values? row-start / column-start / row-end / column-end. Remember: rows first, then columns, start before end.
What is the difference between grid-area and grid-template-areas? 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.
Can grid-area use span? 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.
Which browsers support grid-area? 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.
About the author Developer, cloud engineer, and technical writer
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
Helpful Share Copy link Suggestion