Skill ID: LayingThingsOut_3
Description: Make sure there's the same amount of space between each item, or around each item.
Where to apply: Navigation links across a bar, a gallery of photos, a list of features.
Key Tailwind Classes:
justify-between
,
justify-around
,
justify-evenly
,
gap-4
Gotcha:
justify-*
classes control spacing along the main axis (horizontal for
flex-row
, vertical for
flex-col
).
gap-*
is often simpler and works for space *between* items in both flexbox and grid.
Using
justify-between
(parent is
flex
):
Using
justify-around
(parent is
flex
):
Using
justify-evenly
(parent is
flex
):
Using
gap-4
(parent is
flex
):
Note:
gap-4
creates space *between* items. For outer spacing like
justify-around
or
justify-evenly
, you'd still use those justify properties or add padding to the container.