CSS Grid Generator

Build your layout. Take the code.

Arrange rows, columns and items visually. Preview your layout at any size, then export clean HTML and CSS.

CSS Grid layout builder

Live preview

Read-only code. Use the layout controls to update the code and live preview.

CSS is layout-only. Download HTML includes both code and example styling.

Your layout stays in your browser

From an idea to a CSS Grid layout

CSS Grid arranges content in rows and columns. This visual CSS grid generator lets you build card galleries, sidebar layouts and dashboards without writing every grid rule by hand. The preview uses the same layout CSS as your export.

How to generate your grid

  1. Choose Cards, Sidebar or Dashboard as your starting layout.
  2. Set the columns, rows and gaps. Select an item to change its position or span.
  3. Test a smaller preview width, then copy the CSS or download a complete HTML example.

Responsive by design

Enable “Stack on small screens” to generate a 640px media query. On smaller screens, items return to one column in HTML order. Desktop and tablet previews are scaled to fit your workspace; the displayed pixel width is the actual preview viewport.

What the builder supports

Use up to 12 equal-width columns, 12 rows and 48 items. Rows grow with their content. Items cannot overlap. Changing the track count repacks your items; if they cannot fit, your last valid layout is preserved. For custom track sizes, nested grids or additional breakpoints, edit the exported CSS in Phoenix Code.

CSS Grid questions

Does the downloaded layout need a library?

No. The export uses native HTML and CSS Grid. The downloaded HTML is a complete example with embedded styles, and works without this generator or an internet connection.

What is the difference between CSS Grid and Flexbox?

Grid controls rows and columns together, making it useful for page layouts and card collections. Flexbox lays items out along one axis, making it useful for toolbars and navigation. A page can use both.

Is my layout uploaded anywhere?

Layout generation and export run locally in your browser. Layout values, labels and generated code are excluded from analytics. Refreshing resets the builder, so download your HTML to keep your work.