Class Names
Container
Item
Flexbox Online
Generator & Calculator
The free CSS Flexbox generator, creator and visual calculator β build any layout instantly, then export clean CSS, nested SCSS or Tailwind utility classes.
Name Your Classes
Set a custom container class and item prefix. All generated output uses your exact names β paste-ready for your project.
Configure the Container
Adjust flex-direction, flex-wrap, justify-content, align-items, and row/column gap β the preview updates live.
Tune Each Item
Add up to 6 items. Select any one and control flex-grow, flex-shrink, flex-basis, align-self and order per item.
Export Your Format
Switch between CSS, nested SCSS, or a JSX-ready Tailwind class list. Hit Copy and paste straight into your codebase.
CSS Flexbox Properties Reference
Every property in this Flexbox generator β explained clearly for beginners and pros alike.
Container Properties
Item Properties
When to Use This Flexbox Creator
Flexbox is a one-dimensional layout engine β perfect for rows and columns of content. Here are the most common real-world patterns:
Navigation Bars
Logo left, links right β achieved instantly with justify-content: space-between.
Card Rows
Responsive wrapping card grids using flex-wrap: wrap and a consistent gap.
Centered Content
Vertical + horizontal centering: justify-content and align-items: center.
Sidebar Layouts
Fixed sidebar + fluid main content β set flex-grow: 1 on the main area.
Button Groups
Align icons with text, or space action buttons consistently using gap.
Form Layouts
Label + input side-by-side, collapsing to column on mobile with flex-direction.
Frequently Asked Questions
Flexbox Online is a free browser-based CSS Flexbox generator and visual calculator. Adjust every container and item property using sliders and dropdowns, see the result instantly in the live preview, then copy production-ready CSS, SCSS, or Tailwind classes directly into your project β zero setup, zero sign-up required.
Yes. Type any valid CSS class name into the Container class field and your preferred prefix into Item prefix. All three output formats (CSS, SCSS, Tailwind) update immediately to use those names β so you can name it .nav-bar and nav-link and get code that matches your project’s conventions out of the box.
The SCSS output nests all item rules inside the container selector using SCSS nesting syntax, and stores the gap values in $variables for easy global tweaks. The plain CSS output uses flat, standalone class selectors compatible with any project without a preprocessor.
The Tailwind tab maps each Flexbox property to the closest utility class β for example flex, flex-row, flex-wrap, justify-between, items-center, gap-4, grow, shrink-0, and order-2. For values without a direct Tailwind match (such as custom flex-basis sizes), it outputs an arbitrary-value class like basis-[120px].
justify-content controls distribution along the main axis (horizontal when using flex-row). align-items controls alignment on the cross axis (vertical in a row layout). Used together they let you position flex items in both dimensions simultaneously β the classic “center everything” pattern is just justify-content: center; align-items: center.
Use Flexbox for one-dimensional layouts where content flows in a single row or column and items sizes are somewhat flexible. Use CSS Grid when you need simultaneous control over rows and columns β like page-level templates or complex multi-column grids. In practice they’re complementary: Grid for the macro layout, Flexbox for components within it.
Try also: CSS Specificity Calculator
