CSS Grid Generator
Arrange rows, columns and items visually. Preview your layout at any size, then export clean HTML and CSS.
CSS Grid layout builder
Read-only code. Use the layout controls to update the code and live preview.
About this tool
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
- Choose Cards, Sidebar or Dashboard as your starting layout.
- Set the columns, rows and gaps. Select an item to change its position or span.
- 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.
Frequently Asked 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.
Last updated:
Build with Phoenix Code
Open your exported layout and keep shaping it: edit the grid CSS and watch the page update with Live Preview, with inline editors for the CSS behind each element.