Preparing tool
How to use CSS Grid & Flexbox Generator
- Choose Grid or Flexbox, then set columns, rows, gaps or alignment.
- In Grid, drag across cells to place an item; in Flexbox, select an item to tune it.
- Copy the CSS and HTML, or start from a preset.
What are the limits of CSS Grid & Flexbox Generator?
Covers the common grid and flexbox properties, not named grid areas, subgrid or masonry. Item sizes in the preview follow your CSS exactly, so check it at your real content sizes. Your layout stays on your device.