Analytics cookies
We use optional Google Analytics to understand which tools are useful and improve the site. Analytics stays off unless you accept. Privacy Policy
Turn a layout idea into clean CSS Grid code. Start with cards, a sidebar, a gallery or a dashboard, then tune the columns and individual items for three screen sizes.
Free · no account · layout generation runs in your browser.
Editing desktop rules (1024 px and up)
Spans and starts apply to this screen size. Order and item count apply to all sizes. Fixed positions can override the visible effect of reordering.
1100 CSS px · desktop rules
The frame runs your generated media queries. Wide previews scale to fit this workspace; controls remain full size. Item colors and outlines are examples, outside the exported layout CSS.
Mobile: below 768 px · Tablet: 768–1023 px · Desktop: 1024 px and up. Change the width to test a boundary.
Card grid ready. Choose a preview size to edit its rules.
.layout-grid {
display: grid;
grid-template-columns: repeat(1, minmax(0, 1fr));
grid-auto-rows: minmax(100px, auto);
gap: 16px;
}
@media (min-width: 768px) {
.layout-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 20px;
}
}
@media (min-width: 1024px) {
.layout-grid {
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 24px;
}
}
Layout rules only. Add your content, typography and component styling. The downloaded HTML includes the CSS and works as a standalone example.
Complete the layout with fluid type from CSS Clamp / Fluid Typography Generator and a spacing system from WordPress Spacing System Generator. For a block theme, also explore WordPress theme.json Generator.
Start with Card grid: one column on mobile, two on tablet and three on desktop. Set gaps for each size and let the rows grow with descriptions of different lengths.
Feature + cards gives the first desktop card two columns and two rows. On tablet it spans both columns; on mobile it returns to one. Edit each screen size without forcing a desktop span into a single-column layout.
Sidebar + content uses a 1:3 track ratio on wider screens and a single column below 768 px. Replace the example items with navigation and article content, preserving a sensible reading order.
WordPress has native Grid layout controls for supported blocks, including Group. For a simple equal-card layout, try those controls first. The generator's custom item starts, spans, row sizing and breakpoint rules can require custom CSS beyond the editor's native settings.
For custom CSS, add layout-grid in the container block's Additional CSS class(es) field. Add the matching layout-item-1, layout-item-2 and other generated item classes to its direct child blocks. Put the CSS in the site's available custom CSS area or your theme stylesheet. Check the rendered markup: extra wrappers or theme rules may require selector adjustments.
For theme or template integration, adapt the HTML example to your actual content and enqueue the stylesheet through the theme's normal process. theme.json manages many theme settings and styles, but this download is not a theme.json layout export or a WordPress plugin. Test changes in a staging environment first.
Keep meaningful source order for keyboard and screen-reader users. Visual placement can move a card without changing its reading order.
Yes. Mobile rules are the base CSS, tablet overrides start at 768 px, and desktop overrides start at 1024 px. Preview buttons change the frame's real viewport width; the same generated media queries choose its layout. These are viewport queries, not container queries.
Changing columns clamps spans to the new grid and returns start rows and columns to automatic placement for that screen size. This avoids pushing an existing card outside the new columns. Set new fixed starts afterward if needed.
The editor uses explicit numeric starts and spans rather than freeform dragging. It rejects overlapping placements when both cards have fixed rows and columns. Automatic placement follows normal CSS Grid rules; empty cells can remain after large spans. The code does not use dense packing that could further change visual reading order.
The generated CSS contains layout rules. Preview colors, borders, padding and selection outlines are example styling. Your font, content, wrappers and other styles determine the final appearance. Fixed rows may overflow with long content; choose content-sized rows when cards need to grow.
The current layout is kept only in page memory. Copy the code or download the HTML before leaving. This version does not import CSS, store projects, export themes or create nested grids.