CSS Grid Generator: Card Grids, Galleries and Page Layouts

What is it?

The CSS Grid Generator helps you build a web page layout with CSS grid, visually. Start from a ready layout, set the columns, rows and gaps, and copy the CSS and HTML.

Who is it for?

Web designers building galleries and card layouts, Blogger theme editors, developers prototyping pages, and students learning CSS grid.

How to use it

  1. Pick a Layout preset.
  2. Adjust columns, rows and gaps.
  3. Tap Copy and paste the CSS and HTML into your page.

Grid or flexbox?

Use grid for two-dimensional layouts (rows and columns together, like galleries and page structure) and flexbox for one row or column of items, like menus and button groups.

Errors and how to fix them

  • Grid breaks on phones: use the responsive cards preset (repeat(auto-fit, minmax(…))) so columns drop automatically.
  • Items overflow: long words or images wider than a column; add min-width: 0 to items and max-width: 100% to images.
  • Layout ignores grid: display: grid must be on the direct parent of the items.

Questions people ask

  • What are template areas? Named regions like header, sidebar and footer that make page layouts readable.
  • Can I nest grids? Yes, any grid item can be a grid too.

Practical tip

Start from the responsive cards preset for galleries and blog listings: it adapts from one column on phones to several on desktops without any media queries.

Open the tool: CSS Grid Generator

Still stuck?

Contact support. Tell us which tool or page you were using, what you tapped, what you saw, and your phone or computer and browser (for example: Android phone, Chrome). We reply by email.

Questions, or an error not listed here?

Tell us in the comments: what you were doing, the exact message you saw, and your device and browser. We read every comment and add new fixes to this article.