DevToolsHub Free · Fast · 100% in your browser

Flexbox & Grid Playground

Experiment with CSS Flexbox and Grid properties visually, see the layout update live and copy the generated CSS.

1
2
3
4
5
6
.container {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: stretch;
  align-content: normal;
  gap: 12px;
}

About this Flexbox and CSS Grid playground

Learn and prototype CSS layouts by changing Flexbox and Grid properties and watching the result instantly. Adjust direction, wrapping, justify-content, align-items, grid-template-columns, auto-flow and gap, then copy the generated CSS.

How to use the Flexbox & Grid Playground

  1. Choose flex or grid.
  2. Change the properties and number of items.
  3. Copy the generated CSS.

Example

.container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

Frequently asked questions

When should I use Grid instead of Flexbox?

Use Flexbox for one-dimensional layouts (a row or a column) and Grid for two-dimensional layouts with rows and columns.

What does repeat(auto-fill, minmax(200px, 1fr)) do?

It creates as many columns of at least 200px as fit, stretching them to fill the row. It's a responsive grid without media queries.

Is my data safe?

Yes. The tool runs entirely in your browser using WebAssembly. Nothing you type or upload is sent to a server, logged or stored.

Is it free?

Yes, completely free with no sign-up, no limits and no watermarks. It also works offline once the page has loaded.

An unhandled error has occurred. Reload ✕