Skip to main content

Flexbox Playground

Try CSS flexbox settings with a live preview, then copy the CSS or Tailwind classes. Direction, wrap, justify, align and gap. Free and private.

More options

Preview

1
2
3
4

CSS

Shortcuts: Ctrl+Enter run · Ctrl+Shift+C copy result · / search (use ⌘ on Mac)

Next steps

Done here? Use the Send to… menu on the result to carry it on to CSS Beautifier or CSS Minifier.

Free Online CSS Flexbox Playground and Generator

Change the flexbox settings and watch the boxes move. When it looks right, copy the CSS or the Tailwind classes. It gives developers a quick browser-based way to solve a focused flexbox playground task before moving the result into a project.

How to use the playground

Choose the direction, wrapping, how items line up and the gap. The preview shows boxes in a flex container. Add or remove boxes to test how it wraps.

Copy the code

Switch between CSS and Tailwind and copy the result into your project. Only settings that differ from the defaults are written.

Common mistakes

  • Forgetting that justify and align swap when the direction is column.
  • Expecting items to wrap without flex-wrap: they shrink instead, and can overflow.

Frequently asked questions

What is the main axis?
The direction items flow in. With row it is left to right, with column it is top to bottom. "Justify" lines items up along the main axis and "align" along the other one.
When do I use space-between?
To push the first item to the start and the last to the end with equal gaps between, for example a logo on the left and a menu on the right.
Flexbox or grid?
Flexbox is for one line of things (a row of buttons, a menu). Grid is for layouts in two directions (rows and columns together). The CSS Grid Generator covers that.
Does the Tailwind output match the CSS?
Yes: flex, flex-col, justify-between, items-center and gap-4 are the same settings. A gap that is not on Tailwind's scale is written as gap-[13px].
How do I use this flexbox playground tool?
Use the interactive controls above; processing stays in your browser and the result is intended as a practical starting point for development work.

More Frontend & Design

View all Frontend & Design tools →