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

Flexbox Playground runs entirely in your browser on DevTools — no signup, no upload.

What this tool does not do

  • Flexbox Playground is a free in-browser utility, not a hosted API, and keeps no server-side history.

How to use this tool

  1. Using Flexbox Playground

    Open Flexbox Playground, enter or paste your input, and copy the result.