Flexbox

Tailwind CSS justify-between Class

The justify-between utility class generates the following CSS when applied to an element.

CSS Output

CSS
.justify-between {
  justify-content: space-between;
}

Variants

Use these variant prefixes to apply justify-between conditionally:

responsive:justify-between

Use It

HTML
<nav class="flex justify-between items-center p-4">
  <div class="font-bold">Logo</div>
  <div class="flex gap-4">Links</div>
</nav>

Understanding justify-between

The Tailwind CSS justify-between utility applies justify-content: space-between; to an element when added to its class attribute. It distributes flex items evenly with the first item at the start and the last at the end. The remaining space is divided equally between items.

This utility is part of Tailwind's Flexbox module, designed for building flexible one-dimensional layouts with powerful alignment and distribution controls. In Tailwind's utility-first workflow, you add justify-between directly to your HTML elements rather than writing custom CSS. This approach accelerates development and keeps styles co-located with your markup, making it easy to see exactly how each element is styled at a glance.

Common responsive variants include sm:justify-between, md:justify-between, lg:justify-between, and xl:justify-between, allowing different behavior at each breakpoint. State variants like hover:justify-between and focus:justify-between enable interactive styling without any JavaScript. You can also combine multiple variants for fine-grained control over when the utility applies.

This class works well alongside `justify-around`, `justify-evenly`, `justify-start`, `justify-end` to build complete, production-ready interfaces. Tailwind's tree-shaking ensures only utilities you actually use appear in your final CSS bundle, keeping file sizes minimal. Browser support for the underlying CSS is excellent across Chrome, Firefox, Safari, and Edge.

Related Classes

Explore More Tailwind Classes

Browse our complete reference of 321 Tailwind CSS utility classes with CSS output, variants, and examples.