Flexbox Layout Generator

Combine row, column, alignment, wrap, and gap in one box, then copy the HTML and CSS you see. Presets cover the usual jobs: a row, align to the end, center, a column, wrapping, gap, and filling the width.

This tool has been used … times.

Presets

Code output


          
        

Box colors are for the preview only. The copied CSS does not include them.

Container

Direction (flex-direction)

Wrap (flex-wrap)

Main axis (justify-content)

Cross axis (align-items)

Lines (align-content)

Line packing applies only when items wrap.

Preview height

Cross-axis centering, and the position of wrapped lines, only show when the container has extra height.

Items 4

Item settings

Editing item 1. Click a box in the preview to switch items.

Sizing (flex)

flex: 1 ignores content size and makes equal widths. flex: auto keeps the content size and shares only the leftover space.

Order

This item only (align-self)

How to use

  1. Pick a preset, or set the container yourself.
  2. Click a box in the preview to edit only that item. The number on the box is its place in the HTML.
  3. The line under the preview shows if justify-content is acting horizontally or vertically. A column swaps the axes.
  4. Copy HTML and CSS, or CSS only, then rename .flex-layout and .flex-item on your page.

Please review the Terms of Service for this web app before using it.

Found a bug or have feedback? Let us know here.

Report bugs, display issues, usability problems, or suggestions for improvement.
Consent
– This form is for bug reports only. In principle, we do not respond to individual submissions.
– If a submission contains defamatory, threatening, or otherwise inappropriate content, we may take appropriate action based on logs such as IP addresses.