CSS Grid Layout & Cell Spanning Generator

Build a two-dimensional CSS Grid visually with adjustable tracks, gaps, cell placement and row or column spanning.

↗ Explore tools
CUSTOMIZE

Controls

Preparing controls…
Changes appear instantly in the preview.
SEE YOUR CHANGES

Live preview

Live
Initializing preview…
READY TO USE

Generated code

CSS
/* Your CSS will appear here */
MASTER THE PROPERTY

CSS Grid Layout & Cell Spanning Generator: how it works

Set the track count, select any item, then click a square in the placement matrix to position it and adjust its spans. The generator updates the preview and CSS output immediately, so you can test different choices before committing them to your project.

Popular ways to use this CSS generator

  • Create product grids, gallery layouts and dashboard sections.
  • Fine-tune grid gaps and repeat() track definitions.
  • Position featured cards across multiple rows and columns.

For more ideas, try the related tools below. All controls work right in your browser, and the generated code can be included in your own stylesheet.

COMMON QUESTIONS

About css grid CSS.

When should I use CSS Grid instead of Flexbox?

Grid is ideal when you need explicit rows and columns. Flexbox is usually better for arranging content along a single axis.

How do I make a grid item span two columns?

Use grid-column: span 2 or a starting line with span, such as grid-column: 1 / span 2.

Can grid items be placed explicitly?

Yes. Use grid-row and grid-column to assign start lines and track spans for selected items.

How do I make a responsive CSS Grid layout?

A common pattern is grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); which automatically fits as many minimum-width columns as the container allows.

What is the difference between grid-template-columns and grid-template-rows?

grid-template-columns defines the column tracks; grid-template-rows defines the row tracks. Gaps set spacing between tracks.

How can an item span multiple CSS Grid columns?

Use grid-column: span 2; or specify start and end grid lines. Grid-row works similarly for spanning rows.

When should I use Grid instead of Flexbox?

Use CSS Grid when you need explicit two-dimensional control over rows and columns, such as dashboards, galleries, and complex card layouts.

Box ShadowEffectsBorder RadiusShapesGradientColorsText ShadowTypographyGlassmorphismEffectsFlexboxLayoutCSS GridLayout3D TransformMotionClip PathShapesCSS FilterImages

Tip: press Ctrl + K or ⌘ + K to search anywhere.