Tailwind Flexbox lesson

Distribute items with justify

justify-* controls how a flex container distributes its children along the main axis. On a row, that is horizontal; on a column, it is vertical.

Common utilities

ClassPlacement
justify-startAt the beginning of the main axis.
justify-centerIn the center.
justify-endAt the end of the main axis.
justify-betweenAt both ends, with equal space between items.
justify-aroundWith space around every item.
justify-evenlyWith equal space everywhere.

Try it

A navigation bar is a familiar use: send its two groups to opposite sides.

<nav class="flex justify-between">
  <a href="/">Home</a>
  <div>Account</div>
</nav>

Practice in Flexwind Froggy

More flexbox lessons