Home/Tools/Layout/Grid Template Areas Editor
Layout · Generator

Grid Template Areas Editor

Paint named grid areas on a visual grid and instantly get grid-template-areas CSS.

Grid Size

3
3
12px

Named Areas

header
sidebar
main
footer

Click area to select, then paint cells in the grid

Track Sizes

Row heights

Row 1
Row 2
Row 3

Column widths

Col 1
Col 2
Col 3

Grid Painter

header
header
header
sidebar
main
main
footer
footer
footer

Click or drag to paint — selected: header

Live Preview

header
sidebar
main
footer
Generated CSS
.grid-container {
  display: grid;
  grid-template-areas:
    "header header header"
    "sidebar main main"
    "footer footer footer";
  grid-template-rows: 80px 1fr 60px;
  grid-template-columns: 200px 1fr 1fr;
  gap: 12px;
}

.header { grid-area: header; }
.sidebar { grid-area: sidebar; }
.main { grid-area: main; }
.footer { grid-area: footer; }
100%
Free, no
sign-up needed
0
Code written
by hand
85+
CSS tools
in one place
<1s
Copy-ready
CSS instantly
What is this

What is the CSS Grid Template Areas?

Visually design named grid areas by drawing a layout grid. Assign area names to cells, then copy the grid-template-areas and placement CSS.

Everything runs locally in your browser. Adjust the controls above, preview instantly, and copy clean, production-ready CSS — no account, no upload.

How to use

Using the CSS Grid Template Areas

Everything lives in the panel at the top of this page. There is nothing to install — it all runs right here in your browser.

1

Draw your layout grid

Set the number of rows and columns, then click and drag to paint cells with named areas. Type the area name in each cell.

2

Set column and row sizes

Enter values for grid-template-columns and grid-template-rows. Use fr, px, rem, or keywords like auto and min-content.

3

Copy the complete CSS

Click Copy to get the container rules with grid-template-areas and the individual area placement rules for each named section.

The output

What the generated code looks like

Clean, production-ready CSS — no vendor bloat, no unnecessary declarations.

styles.css
.layout {
  display: grid;
  grid-template-areas:
    "header header header"
    "sidebar main    main  "
    "footer footer footer";
  grid-template-columns: 260px 1fr 1fr;
  grid-template-rows: 64px 1fr 56px;
  gap: 16px;
  height: 100vh;
}

.header  { grid-area: header; }
.sidebar { grid-area: sidebar; }
.main    { grid-area: main; }
.footer  { grid-area: footer; }

Named areas make the layout self-documenting. Reading the template string is nearly as clear as a wireframe.

Pro tips

Pro tips for better results

Use a dot (.) for empty cells

A period in grid-template-areas represents an unnamed empty cell. Multiple periods with no spaces (.... ) represent multiple empty cells: "header . aside".

Area shapes must be rectangular

Named areas must form a rectangle. An L-shaped area is invalid CSS and will cause the entire grid to fail. If you need non-rectangular regions, use grid-column and grid-row directly.

Named areas with grid-area are the most readable Grid code

A layout defined with grid-template-areas is immediately legible as a visual map. Prefer it over numeric line references for page-level layouts.

FAQ

Frequently asked questions

No - grid-template-areas is one of several ways to place items. You can also use grid-column and grid-row with line numbers. Named areas are most useful for full-page layouts where readability matters.
No - each area name must appear in a contiguous rectangular region. Using the same name in non-adjacent cells is invalid CSS.
No. Everything runs in your browser. Nothing is sent to a server.

From the blog

Read more