← Back

CSS Flexbox Playground

LOCAL

Test Flexbox properties & generate CSS.

Input

Output

What is CSS Flexbox Playground?

CSS Flexbox Playground generates declarations for a flex container from direction, distribution, alignment and gap controls. It returns code after you choose Generate; there is no rendered item preview. Put the declarations inside a selector for your parent element to try them with your own children.

How to use CSS Flexbox Playground

Choose row for Direction, center for Justify content, center for Align items and 12 for Gap. Expect display: flex;, flex-direction: row;, justify-content: center;, align-items: center; and gap: 12px;. In a typical left-to-right horizontal writing mode, the row’s main axis is horizontal.

When is CSS Flexbox Playground useful?

Justify content distributes remaining space along the main axis; align items works on the cross axis. Switching Direction to column switches which axis each setting controls. Centering along an axis needs available space: a content-sized parent may show little change. For vertical centering, give the parent an appropriate height or minimum height in your own CSS.

Example

Try space-between to distribute free space between items, while the gap declaration supplies a minimum gutter. The generator does not add flex-wrap, item sizing or breakpoints. To allow a row to wrap on narrow screens, add flex-wrap: wrap; yourself and check long labels; the default nowrap behavior can otherwise shrink items or cause overflow.

Practical notes

Use this output for toolbars, button groups and other arrangements following one main axis. Use the Grid Generator when rows and columns need coordinated tracks. Reversed visual directions do not change the DOM reading order. The justify-content reference describes distribution options. Generation runs locally without fetching a target website.