Justify Content
Controls the positioning of flex and grid elements on a container's main axis.
Class | Properties |
---|---|
jc-c | justify-content: center; |
jc-fe | justify-content: flex-end; |
jc-fs | justify-content: flex-start; |
jc-n | justify-content: normal; |
jc-s | justify-content: stretch; |
jc-sb | justify-content: space-between; |
jc-sa | justify-content: space-around; |
jc-se | justify-content: space-evenly; |
Center
This example sets the justify content to center. The items will be centered within the container along the main axis.
<div class="d-f g-4 jc-c stripes tc-white"> <div class="ai-c bg-indigo d-f dim-14 jc-c p-4 rad-1">A</div> <div class="ai-c bg-indigo d-f dim-14 jc-c p-4 rad-1">B</div> <div class="ai-c bg-indigo d-f dim-14 jc-c p-4 rad-1">C</div></div>
Flex End
This example sets the justify content to 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 stripes tc-white"> <div class="ai-c bg-indigo d-f dim-14 jc-c p-4 rad-1">A</div> <div class="ai-c bg-indigo d-f dim-14 jc-c p-4 rad-1">B</div> <div class="ai-c bg-indigo d-f dim-14 jc-c p-4 rad-1">C</div></div>
Flex Start
This example sets the justify content to 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 stripes tc-white"> <div class="ai-c bg-indigo d-f dim-14 jc-c p-4 rad-1">A</div> <div class="ai-c bg-indigo d-f dim-14 jc-c p-4 rad-1">B</div> <div class="ai-c bg-indigo d-f dim-14 jc-c p-4 rad-1">C</div></div>
Normal
This example sets the justify content to normal. The items will be aligned according to the default alignment of the container.
<div class="d-f g-4 jc-n stripes tc-white"> <div class="ai-c bg-indigo d-f dim-14 jc-c p-4 rad-1">A</div> <div class="ai-c bg-indigo d-f dim-14 jc-c p-4 rad-1">B</div> <div class="ai-c bg-indigo d-f dim-14 jc-c p-4 rad-1">C</div></div>
Stretch
This example sets the justify content to stretch. The items will stretch to fill the available space along the main axis.
<div class="ovf-auto rad-1 tc-white"> <div class="d-g g-4 gaf-c jc-s rstripes ad-1"> <div class="ai-c bg-indigo d-f h-14 jc-c rad-1">A</div> <div class="ai-c bg-indigo d-f h-14 jc-c rad-1">B</div> <div class="ai-c bg-indigo d-f h-14 jc-c rad-1">C</div> </div></div>
Space Between
This example sets the justify content to 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 stripes tc-white"> <div class="ai-c bg-indigo d-f dim-14 jc-c p-4 rad-1">A</div> <div class="ai-c bg-indigo d-f dim-14 jc-c p-4 rad-1">B</div> <div class="ai-c bg-indigo d-f dim-14 jc-c p-4 rad-1">C</div></div>
Space Around
This example sets the justify content to space-around. The items will be evenly distributed in the container with space around them.
<div class="d-f g-4 jc-sa stripes tc-white"> <div class="ai-c bg-indigo d-f dim-14 jc-c p-4 rad-1">A</div> <div class="ai-c bg-indigo d-f dim-14 jc-c p-4 rad-1">B</div> <div class="ai-c bg-indigo d-f dim-14 jc-c p-4 rad-1">C</div></div>
Space Evenly
This example sets the justify content to 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 stripes tc-white"> <div class="ai-c bg-indigo d-f dim-14 jc-c p-4 rad-1">A</div> <div class="ai-c bg-indigo d-f dim-14 jc-c p-4 rad-1">B</div> <div class="ai-c bg-indigo d-f dim-14 jc-c p-4 rad-1">C</div></div>
Conditional styles
Learn how to override existing utilities based on the user's screen size or other factors, such as hover states.
You can combine responsive breakpoints like sm:jc-*
,md:jc-*
, lg:jc-*
, and xxl:jc-*
allows targeting specific utilities in different viewports.
<div class="jc-fs md:jc-fe ..."></div>
Alternatively, you can apply :hover
by using h:jc-*
utility to override elements and change their values when hovering over them.
<div class="jc-fs h:jc-fe ..."></div>