Flexbox Playground Free

Flip the switches on the container and on individual items and watch the layout respond. When it looks right, copy the CSS or the matching Tailwind classes.

Click an item to edit it.

Item 1

CSS
.container {
  display: flex;
  gap: 12px;
}
Tailwind
<div class="flex gap-[12px]">
  <div class="">1</div>
  <div class="">2</div>
  <div class="">3</div>
</div>
Built by Pyalm

Pyalm designs and builds fast, conversion-focused websites in Next.js — the same stack these tools run on. If you'd rather have it built than fiddle with CSS, talk to us.

Pyalm serviceWebsite developmentFast, SEO-ready business websites and web apps built in Next.js — designed around the questions your buyers ask.See website development Pyalm serviceCustom softwareInternal tools, portals and business systems built around how your team actually works — not the other way round.See custom software

Flexbox in one sentence

Flexbox lays children out along one axis (a row or a column), distributes spare space with justify-content, aligns items on the cross axis with align-items, and lets each item grow or shrink with the flex shorthand.

The properties that matter most

display:flex, flex-direction, gap, justify-content and align-items cover most layouts. Add flex-wrap for responsive rows of cards, and flex:1 on an item to make it fill the remaining space.

Related

More free tools you might need

🌬️

Tailwind CSS PlaygroundFree

Write HTML with Tailwind CSS classes and see it render live — with starter templates.

🔲

CSS Box Shadow GeneratorFree

Design layered CSS box shadows visually and copy the CSS or Tailwind class.

🎨

Color Palette GeneratorFree

Generate harmonious colour palettes, lock the ones you like, extract colours from an image and export as CSS or Tailwind.

Browse all free tools

FAQ

Frequently asked questions

Flexbox or grid?

Use flexbox for one-dimensional layouts — a nav bar, a row of buttons, a card's internals. Use CSS grid when you need rows and columns aligned together, such as a page layout or gallery.

Why doesn't justify-content do anything?

It only distributes free space. If items already fill the container (or an item has flex-grow), there's no space left to distribute.

Want a website that ranks and converts?

Pyalm designs and builds fast, conversion-focused websites in Next.js — the same stack these tools run on. If you'd rather have it built than fiddle with CSS, talk to us.

See website development