Flexbox & GridJustify Self

Justify Self

Controls the alignment of a single grid element relative to its inline axis.

ClassStyle
js-autojustify-self: auto;
js-cjustify-self: center;
js-ejustify-self: end;
js-sjustify-self: start;
js-stjustify-self: stretch;

Auto

Initial value

The item will use the default alignment based on the container's alignment properties.

<div class="d-g g-4 gtc-3 tc-white" id="area">
<div class="ai-c bg-indigo-8 d-f d-14 jc-c rad-1 tc-indigo-5">A</div>
<div class="ai-c bg-indigo d-f d-14 jc-c js-auto rad-1 tc-white">B</div>
<div class="ai-c bg-indigo-8 d-f d-14 jc-c rad-1 tc-indigo-5">C</div>
</div>

Center

The item will be centered within its grid area along the inline axis.

<div class="d-g g-4 gtc-3 tc-white" id="area">
<div class="ai-c bg-indigo-8 d-f d-14 jc-c rad-1 tc-indigo-5">A</div>
<div class="ai-c bg-indigo d-f d-14 jc-c js-c rad-1 tc-white">B</div>
<div class="ai-c bg-indigo-8 d-f d-14 jc-c rad-1 tc-indigo-5">C</div>
</div>

End

The item will be aligned to the end of its grid area along the inline axis.

<div class="d-g g-4 gtc-3 tc-white" id="area">
<div class="ai-c bg-indigo-8 d-f d-14 jc-c rad-1 tc-indigo-5">A</div>
<div class="ai-c bg-indigo d-f d-14 jc-c js-e rad-1 tc-white">B</div>
<div class="ai-c bg-indigo-8 d-f d-14 jc-c rad-1 tc-indigo-5">C</div>
</div

Start

The item will be aligned to the start of its grid area along the inline axis.

<div class="d-g g-4 gtc-3 tc-white" id="area">
<div class="ai-c bg-indigo-8 d-f d-14 jc-c rad-1 tc-indigo-5">A</div>
<div class="ai-c bg-indigo d-f d-14 jc-c js-s rad-1 tc-white">B</div>
<div class="ai-c bg-indigo-8 d-f d-14 jc-c rad-1 tc-indigo-5">C</div>
</div>

Stretch

The item will stretch to fill its grid area along the inline axis.

<div class="d-g g-4 gtc-3 tc-white" id="area">
<div class="ai-c bg-indigo-8 d-f d-14 jc-c rad-1 tc-indigo-5">A</div>
<div class="ai-c bg-indigo d-f d-14 jc-c js-st rad-1 tc-white">B</div>
<div class="ai-c bg-indigo-8 d-f d-14 jc-c rad-1 tc-indigo-5">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.

Using media queries

You can combine responsive breakpoints like sm:js-*, md:js-*, lg:js-*, and xxl:js-* to allow targeting specific utilities in different viewports.

Using hover states

Alternatively, you can apply :hover by using h:js-* utility to override elements and change their values when hovering over them.