Learn Computer Academy
বাংলা

Grid Generator

Drag across cells to place items on a real CSS Grid — no typed line numbers required to get started. Add tracks, mix fr/px/auto/minmax, and watch grid-template-areas build itself from what you drew.

Read the display & visibility lesson

Columns

Track 1
Track 2
Track 3

Each track is one column (or row) width. fr shares leftover space by ratio; px is a fixed size; auto fits content; minmax(150px, 1fr) never shrinks below its minimum.

Rows

Track 1
Track 2

Each track is one column (or row) width. fr shares leftover space by ratio; px is a fixed size; auto fits content; minmax(150px, 1fr) never shrinks below its minimum.

Gap

justify-items

How each item is positioned inside its own cell along the row axis, when the item is narrower than the cell.

align-items

How each item is positioned inside its own cell along the column axis, when the item is shorter than the cell.

justify-content

How the whole track grid is positioned inside the container when the tracks add up to less than the container width.

align-content

How the whole track grid is positioned inside the container when the tracks add up to less than the container height.

Click and drag across empty cells, then release to place an item there.

header
main
aside

Items (3)

Item: header

Placement (grid lines, 1-indexed)

justify-self
align-self

Presets

grid-template-areas (derived from your layout)

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

Generated CSS

.container {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: auto 1fr;
  gap: 16px;
}

.header {
  grid-column: 1 / 4;
  grid-row: 1 / 2;
}

.main {
  grid-column: 1 / 3;
  grid-row: 2 / 3;
}

.aside {
  grid-column: 3 / 4;
  grid-row: 2 / 3;
}