DevTools Logo

Flexbox Playground

Flexbox Playground

Visually configure a CSS flexbox container and copy the generated CSS

Flex settings

Presets:

Examples

Centered hero section

.flex-container {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  flex-wrap: nowrap;
  gap: 16px;
}

Centers items both horizontally and vertically — the classic pattern for a hero or modal.

Responsive wrapping card gallery

.flex-container {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 24px;
}

Cards wrap to new rows automatically and all stretch to the same height, ideal for a responsive grid of equal-height cards.

Details

CSS Flexbox is a one-dimensional layout model that makes it easy to align and distribute space among items in a container. This playground lets you tweak all the major flex-container properties — direction, justification, alignment, wrapping, and gap — and see numbered items react in real time. Everything runs locally in your browser; no data is ever sent anywhere.

About this tool

Experiment with CSS Flexbox properties in a live preview. Adjust direction, alignment, wrapping, and gap, then copy production-ready CSS. Flexbox Playground runs in the browser on DevTools. There is no signup, and your input stays on this device unless the tool explicitly performs a live network lookup.

What this tool does not do

  • Flexbox Playground is a free in-browser utility, not a hosted API. It does not keep server-side history and is not a substitute for production verification in your own stack.

How do I use this tool?

  1. How do I use Flexbox Playground?

    Open Flexbox Playground, enter or paste your input, and copy the result. The page works without an account.