Developer Layout Utility

Flexbox Playground

Test justify-content, align-items, flex-direction, flex-wrap, gap, and align-content in real time, then generate CSS code instantly.

Live Flexbox Preview See item alignment, direction, wrapping, and spacing update instantly as you change each property.
Automatic CSS Generation Generate container and item CSS code based on your current Flexbox settings.
Layout Learning Tool Understand the difference between justify-content, align-items, and align-content visually.

Flexbox Settings

Configure the direction, alignment, wrapping, spacing, and item size of a Flex container.

Quick Presets Apply commonly used Flexbox layout patterns instantly.
0px 16px 60px
0px 24px 60px
2 5 16
240px 420px 700px
60px 92px 220px
60px 86px 180px
0px 20px 40px
Live Preview
Direction row
Gap 16px
Wrap nowrap

Generated Result

CSS code generated from the current Flexbox settings.

Ready
Change the Flexbox settings and click the Generate CSS Code button.

Flexbox Alignment Comparison

Once you understand direction and axis concepts, Flexbox becomes useful for button groups, card lists, and navigation layouts.

justify-content

Controls alignment along the main axis. In row direction it controls horizontal alignment, and in column direction it controls vertical alignment.

align-items

Controls alignment along the cross axis. Items can be placed at the start, center, end, or stretched.

align-content

Controls the alignment of multiple flex lines when flex-wrap creates more than one line.

Practical guide

Understand Flexbox axes before copying the layout

Explore direction, alignment, wrapping and spacing in a live Flexbox preview. Export both container rules and the sample item dimensions.

Who this helps

  • Developers learning Flexbox alignment
  • Designers arranging toolbars or card rows

When to use this tool

  • Center an empty-state component.
  • Compare wrapping and multiline alignment.

From input to a checked result

  1. 1

    Choose the main-axis direction.

  2. 2

    Set justify-content for main-axis free space.

  3. 3

    Set align-items for alignment within a line.

  4. 4

    Enable wrapping and compare align-content when multiple lines exist.

  5. 5

    Adjust item sizes and export CSS, then test DOM order and long translations.

Example 1

Centered content

Input
row; justify-content:center; align-items:center
Result
Items centered on both axes when space is available.

The container's minimum height makes vertical alignment visible.

Example 2

Wrapping cards

Input
row; wrap; gap 16px
Result
Items move onto further lines when required.

Actual wrapping also depends on item width, flex shrinking and content.

How it works

Selected values are applied to the preview and exported as container CSS. Width, height and border radius are also exported for .flex-item. Item count changes only the demonstration.

Limitations

  • Reverse directions change visual order without rewriting DOM order.
  • align-content needs multiple flex lines and available cross-axis space.
  • Real long words and images can behave differently from numbered boxes.
Your data

Settings stay in the browser and are not uploaded to win-j.

Frequently asked questions

Why does align-content appear to do nothing?

With nowrap there is only one line. Try wrapping, more items and additional cross-axis space.

Are item dimensions only a preview setting?

No. The output includes width, height and radius; adapt them to your component.

Should every layout use Flexbox?

Use the layout system that fits the content. Grid can be more convenient for coordinated rows and columns.