0

justify-content: space-between Explained (CSS)

Build a CSS flexbox layout visually: flex-direction, justify-content, align-items, flex-wrap and gap on the container, plus per-child flex-grow, flex-shrink and flex-basis, all with a live preview and copyable CSS.

Processing... 0%

Result

This page opens the generator with justify-content set to space-between: the first box sits flush against the container's start edge, the last box sits flush against its end edge, and the leftover space is divided into equal gaps between the boxes in the middle — never before the first one or after the last one.

That's the detail people mix up. space-around gives every box an equal margin on both of its sides, so the gaps between boxes end up twice as wide as the gaps at the two outer edges (each edge only gets one box's margin, not two). space-evenly goes further and makes every gap the same size, including the two outer edges — the only one of the three where the spacing looks perfectly uniform all the way across.

Switch the justify-content dropdown between the three values below and watch the same three boxes rearrange — it's the fastest way to see the difference instead of memorizing it. Copy the CSS for whichever one matches the spacing you actually want.