The `justify-*` utilities control spacing along the main axis of a flex container. This means its behavior changes with `flex-direction`.
The `gap-*` utilities are often simpler and more direct for creating space strictly between flex or grid items, regardless of the main axis for `justify-*`. `justify-between` also adds space at the very beginning and end of the container, while `gap-*` only adds space between elements.
Gotcha Summary:
justify-*
depends on the
flex-direction
(main axis).
gap-*
is often a more direct and simpler way to add space *only between* items in both flexbox (row or column) and grid layouts. It doesn't add space at the container's edges like
justify-between
or
justify-around
do.