b2KIT

CSS Grid Template Areas Editor

Visually define grid-template-areas by painting named regions on a grid and export clean CSS.

Tested tool guide Tested browser tools Checked August 16, 2026

What CSS Grid Template Areas Editor does, with a checked example

CSS Grid Template Areas Editor turns a grid of painted labels into the quoted row syntax required by the CSS grid-template-areas property. Choose the grid dimensions, assign names such as header, sidebar, and main to cells, then copy the generated CSS for a grid container. The important constraint is geometric: every repeated name must occupy one solid rectangle. An L-shaped area or the same name in separated cells does not define a valid template area, even if the rows look readable.

Worked example

A concrete input and expected output from the current implementation.

Input

2 x 2 painted grid:
header | header
sidebar | main

Expected output

grid-template-areas:
  "header header"
  "sidebar main";

The two quoted strings define two rows, each containing two cell tokens. Repeating header across both cells in the first row creates a rectangular area spanning two columns.

How the result is produced

1

Cells become row tokens

Each painted grid cell contributes one token to its row. Cells painted with the same name repeat that token. In exported CSS, an unassigned cell is written as a period token. The editor assembles cells from left to right into quoted rows, preserving the chosen row and column count.

2

Names must form rectangles

Read each quoted string as one grid row and each whitespace-separated name as one column position. A named area may repeat horizontally and vertically only when all occurrences fill a rectangle. The declaration defines area placement, not track sizes; use grid-template-columns and grid-template-rows when explicit sizing is needed.

Good uses

  • Drafting a page shell with named header, navigation, main, sidebar, and footer regions.
  • Checking whether a proposed set of repeated area names forms valid rectangular regions.
  • Translating a visual wireframe into grid-template-areas syntax without manually aligning quoted rows.

Limits and checks

  • Every quoted row must contain the same number of cell tokens or the declaration is invalid.
  • Copying the template does not place children by itself; each relevant child needs a matching grid-area value.
  • One declaration represents one arrangement; responsive rearrangements require another grid-template-areas declaration in the appropriate CSS rule.

Common questions

Can one named area be L-shaped or split into separate sections?

No. Under the grid-template-areas grammar, every occurrence of one name must describe a single filled rectangle. Diagonal, L-shaped, and disconnected occurrences make the declaration invalid. Give the pieces different names, or redesign the assignment so every cell inside the area's bounding rectangle has that same name.

Does the exported declaration size tracks and place grid children?

No. grid-template-areas names the regions of the grid container, but it does not choose column widths, row heights, or gaps. It also does not connect a child automatically. Define track sizing separately and set grid-area on each child that should occupy a named region.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools