Loading…
Loading…
Build Flexbox & Grid layouts visually with Tailwind export
.container {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-template-rows: repeat(2, auto);
column-gap: 16px;
row-gap: 16px;
justify-items: stretch;
align-items: stretch;
justify-content: stretch;
align-content: normal;
}Run your projects on Claude Code?
We packaged the .claude config that runs this site — 26 specialist agents, 14 workflow skills, and 6 rule files from 31 real production incidents. From $9.
Get the Claude Code Production Pack — $29CSS Grid and Flexbox are the two primary layout systems in modern CSS, each defined in their own W3C specifications. Grid Layout (CSS Grid Level 1) excels at two-dimensional layouts — placing items across both rows and columns simultaneously. Flexbox (CSS Flexible Box Layout) optimizes one-dimensional alignment — distributing space along a single axis with powerful alignment controls. Both are supported in all modern browsers and expose numerous configuration properties that are difficult to memorize and test without a visual feedback loop.
In Grid mode, the generator exposes controls for grid-template-columns (column count or custom fr/px values), grid-template-rows, gap (row-gap and column-gap independently), and item placement properties. The preview renders a grid with numbered placeholder items and updates instantly as you adjust any property. Column definitions are expressed using repeat() notation and fr units for flexible tracks.
In Flexbox mode, the generator exposes flex-direction, flex-wrap, justify-content, align-items, align-content, and per-item flex-grow, flex-shrink, and flex-basis controls. The preview renders several flex items of varying natural sizes so you can see how the alignment properties interact with different content sizes.
CSS output is generated as a complete ruleset including the container declaration and all item overrides. Tailwind output maps each property to its closest utility class using Tailwind v4 defaults, and uses arbitrary value syntax for values outside the standard scale.
A frontend developer builds a three-column product grid and exports the Tailwind classes to paste directly into a Next.js component without guessing class names.
A developer creates a responsive sidebar layout using Grid areas and copies the CSS to use as a starting template for a dashboard page.
A student learning CSS layout uses the visual editor to understand how justify-content and align-items interact before writing any code manually.
A developer replicates a Figma auto-layout frame as Flexbox CSS, verifying the alignment matches the design using the live preview.
Choose between Grid or Flexbox layout mode
Set columns, rows, gaps and alignment properties
Preview the layout live with resizable items
Copy generated CSS or Tailwind classes
About the CSS Layout Generator
Yes. The generator exports both standard CSS and equivalent Tailwind utility classes for all layout properties.
CSS Grid is a two-dimensional layout system (rows and columns), while Flexbox is one-dimensional (row or column). Grid is better for page layout; Flexbox is better for component layout.
Use grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)). This creates as many columns as fit in the container at the minimum width, and expands them to fill available space. The generator includes this pattern in the responsive presets.
The gap property (formerly grid-gap) sets the space between rows and columns simultaneously. You can set row and column gaps independently using row-gap and column-gap. Gap does not add space around the outer edges of the grid — use padding on the container for that.
The fr (fractional) unit represents a fraction of the available space in the grid container. grid-template-columns: 1fr 2fr 1fr creates three columns where the middle column is twice as wide as the others. It is similar to flex-grow in Flexbox but applies to both dimensions in Grid.
Yes. For Grid, the generator outputs Tailwind classes like grid-cols-3 and gap-4. For custom fr values that fall outside Tailwind defaults, it generates CSS custom property fallbacks. Tailwind v4 also supports arbitrary values in brackets, e.g., grid-cols-[2fr_1fr].
Builder/critic agent prompts with brakes built in
Open →DeveloperFormat, validate & diff JSON — runs entirely in browser
Open →DeveloperTest regex live — railroad diagrams + plain English explained
Open →DeveloperOne color in, full design system out
Open →