CSS Grid Layout Generator
Build equal columns, a sidebar layout or an auto-fitting card grid. Resize the preview, tune the gaps, and download a working HTML/CSS example for your project.
1. Choose a layout
Auto-fit uses the container width. The fixed-column breakpoint uses the browser viewport width. In the preview, the selected width simulates that viewport so you can check stacking.
2. Preview your layout
3. Use the code
Restore project settings
Exports use neutral .layout and .card classes. Rename them to avoid collisions in your project. The code sets layout geometry; the downloaded demo adds optional decorative card styling. It does not reproduce every detail of your site or generate arbitrary item spans.
Using CSS Grid Layout Generator
Create practical grid geometry for a website layout, then test it at a simulated preview width before taking the generated code into your project.
- Choose equal columns, a 1:3 sidebar layout or auto-fit cards. Set item count, spacing and relevant sizing controls.
- Use the simulated preview-width slider to inspect wide and narrow layouts. Fixed grids can stack below a viewport breakpoint.
- Copy CSS or download the standalone HTML demo. Save/import JSON for reusable settings.
Example
Equal columns: 3; gap: 16 pixels; stack breakpoint: 700 pixels. At a 600-pixel simulated viewport the fixed grid stacks. Auto-fit uses its container width instead.
Questions & answers
What is the difference between auto-fit and fixed columns?
Fixed grids use the selected column count or a 1:3 sidebar pair. Auto-fit creates as many columns as fit the container, using the minimum card width. Its minimum is capped at 100% of the container to prevent narrow-screen overflow.
Does the preview resize my browser?
No. The slider sets a simulated width inside a scrollable preview. Fixed-grid stacking simulates that viewport width. Test the downloaded demo in an actual browser as well.
Does the export include the preview colors?
Copied CSS contains grid geometry and child overflow handling. The standalone HTML demo adds optional card decoration. Neutral layout/card classes should be renamed to fit your project.
Can I create items spanning multiple rows or columns?
This version creates uniform grid items without individual spans or named areas. Use the generated geometry as a starting point for more complex layouts.
Are my settings saved automatically?
No. Save a JSON project and import it later, up to 16 KiB. Supported limits are 1–6 fixed columns, 1–24 preview items and gaps from 0 to 80 pixels.
Help improve this tool
Report a problem or suggest an improvement
Describe the issue without pasting private tool input. Feedback goes to our admin inbox.
