Justify Content
Controls the positioning of flex and grid elements on a container's main axis.
Widely available
This feature is well established and works across many devices and browser versions.
| Class | Style |
|---|---|
jc-c | justify-content: center; |
jc-fe | justify-content: flex-end; |
jc-fs | justify-content: flex-start; |
jc-n | justify-content: normal; |
jc-st | justify-content: stretch; |
jc-sa | justify-content: space-around; |
jc-sb | justify-content: space-between; |
jc-se | justify-content: space-evenly; |
Normal
Initial value
The items will be aligned according to the default alignment of the container.
<div class="d-f g-4 jc-n tc-white"> <div class="ai-c bg-indigo d-f d-14 jc-c d-16">A</div> <div class="ai-c bg-indigo d-f d-14 jc-c d-16">B</div> <div class="ai-c bg-indigo d-f d-14 jc-c d-16">C</div></div>Center
The items will be centered within the container along the main axis.
<div class="d-f g-4 jc-c tc-white"> <div class="ai-c bg-indigo d-f d-14 jc-c d-16">A</div> <div class="ai-c bg-indigo d-f d-14 jc-c d-16">B</div> <div class="ai-c bg-indigo d-f d-14 jc-c d-16">C</div></div>Flex End
The items will be aligned to the end of the container along the main axis.
<div class="d-f g-4 jc-fe tc-white"> <div class="ai-c bg-indigo d-f d-14 jc-c d-16">A</div> <div class="ai-c bg-indigo d-f d-14 jc-c d-16">B</div> <div class="ai-c bg-indigo d-f d-14 jc-c d-16">C</div></div>Flex Start
The items will be aligned to the start of the container along the main axis.
<div class="d-f g-4 jc-fs tc-white"> <div class="ai-c bg-indigo d-f d-14 jc-c d-16">A</div> <div class="ai-c bg-indigo d-f d-14 jc-c d-16">B</div> <div class="ai-c bg-indigo d-f d-14 jc-c d-16">C</div></div>Stretch
The items will stretch to fill the available space along the main axis.
<div class="tc-white"> <div class="d-g g-4 gaf-c jc-s"> <div class="ai-c bg-indigo d-f h-14 jc-c">A</div> <div class="ai-c bg-indigo d-f h-14 jc-c">B</div> <div class="ai-c bg-indigo d-f h-14 jc-c">C</div> </div></div>Space Between
The items will be evenly distributed in the container, with the first item at the start and the last item at the end.
<div class="d-f g-4 jc-sb tc-white"> <div class="ai-c bg-indigo d-f d-14 jc-c d-16">A</div> <div class="ai-c bg-indigo d-f d-14 jc-c d-16">B</div> <div class="ai-c bg-indigo d-f d-14 jc-c d-16">C</div></div>Space Around
The items will be evenly distributed in the container with space around them.
<div class="d-f g-4 jc-sa tc-white"> <div class="ai-c bg-indigo d-f d-14 jc-c d-16">A</div> <div class="ai-c bg-indigo d-f d-14 jc-c d-16">B</div> <div class="ai-c bg-indigo d-f d-14 jc-c d-16">C</div></div>Space Evenly
The items will be evenly distributed in the container with equal space around them.
<div class="d-f g-4 gaf-c jc-se tc-white"> <div class="ai-c bg-indigo d-f d-14 jc-c d-16">A</div> <div class="ai-c bg-indigo d-f d-14 jc-c d-16">B</div> <div class="ai-c bg-indigo d-f d-14 jc-c d-16">C</div></div>Using utility variants
Learn how to override existing utilities based on the user's screen size or other factors, such as hover states.
Targeting different viewports
You can combine responsive breakpoints like sm:jc-*, md:jc-*, lg:jc-*, and xxl:jc-* to allow targeting specific utilities in different viewports.
Targeting hover states
Alternatively, you can apply :hover by using h:jc-* utility to override elements and change their values when hovering over them.