Code · Made a little simpler

CSS Flexbox Playground

Try CSS Flexbox container and item settings in a resizable preview. Edit basis, grow, shrink, order and alignment, then copy or download CSS, HTML and a layout report.

Free to useNo account neededProcessed on your device
Your workspaceProcessed on your device
Flex container
Flex items
Live flex layout
Lead
Support
Links

Preview dimensions stay in this workspace. The export adapts to the available space in your own page.

Generated output

Add this tool to your website

Paste this code into your page to add the tool and a visible ToolMellow credit link.

HTML embed code
Preview embed

CSS Flexbox Playground: how to use it

  1. Load Card row and compare a preview width of 408 pixels with 407 pixels. The third card moves to a new line at the narrower width.
  2. Change container direction, wrapping, alignment, gap or padding. Select an item to change its flex sizing and cross-axis alignment.
  3. Copy the generated CSS and HTML into your project. Use Report to save the chosen values separately.

Limits and notes

One flex container with up to 12 items and bounded numeric settings. Preview width and height are separate from the exported layout. Your work stays in the browser.

How your privacy works →

CSS Flexbox Playground: common questions

What does flex-basis change?

It sets an item's starting main-axis size before the browser distributes extra or missing space.

What is the difference between Item alignment and Line alignment?

Item alignment positions children within a flex line. Line alignment distributes wrapped lines along the cross axis when the container has room.

Does Item order change the generated HTML order?

The order property changes visual placement. Keep the HTML in reading order so speech and keyboard navigation follow the intended sequence.

Guides