CSS Flexbox Generator

CSS Flexbox Generator lets you tune flex-direction, flex-wrap, justify-content, align-items, align-content and gap with dropdowns, see the result in a live preview and produces clean CSS containing only the properties that differ from the defaults.

Items: 5
1
2
3
4
5
.container {
  display: flex;
  gap: 8px;
}

How it works

  1. 1Choose the flex properties from the dropdowns and set the gap.
  2. 2Add or remove items to bring the preview close to your real layout.
  3. 3Copy the CSS with "Copy CSS".

Frequently asked questions

What is the difference between justify-content and align-items?+

justify-content aligns along the main axis (horizontal for row), align-items along the cross axis (vertical for row); the axes swap when flex-direction changes.

When does align-content matter?+

Only when flex-wrap produces several lines; it controls how those lines are distributed.

Why are some properties missing from the CSS?+

Properties at their default value are left out because they are redundant.

Embed on your site

Size
480 × 360px
<iframe
  src="https://toolsqube.com/en/color/flexbox-generator/embed"
  width="480" height="360"
  style="border:0;border-radius:14px"
  title="CSS Flexbox Generator · ToolsQube"
  loading="lazy">
</iframe>

Want to go deeper on this topic: Color and Design Guide →

Command Palette

Search for a command to run…