Skip to content

Justify Self โ€‹

Utilities for controlling the alignment of individual grid items along the inline (row) axis.

Class NameCSS Equivalent
justify-self-startjustify-self: start;
justify-self-centerjustify-self: center;
justify-self-endjustify-self: end;
justify-self-stretchjustify-self: stretch;
justify-self-autojustify-self: auto;

Justify Self Start โ€‹

The .justify-self-start class sets the justify-self property to start, aligning the individual grid item along the inline (row) axis at the start.

html
<div class="grid grid-cols-3  justify-items-stretch gap-s">
  <div class="[...]">1</div>
  <div class="[...] justify-self-start">2</div>
  <div class="[...]">3</div>
  <div class="[...]">4</div>
  <div class="[...]">5</div>
  <div class="[...]">6</div>
</div>
1
2
3
4
5
6

Justify Self Center โ€‹

The .justify-self-center class sets the justify-self property to center, aligning the individual grid item along the inline (row) axis at the center.

html
<div class="grid grid-cols-3  justify-items-stretch gap-s">
  <div class="[...]">1</div>
  <div class="[...] justify-self-center">2</div>
  <div class="[...]">3</div>
  <div class="[...]">4</div>
  <div class="[...]">5</div>
  <div class="[...]">6</div>
</div>
1
2
3
4
5
6

Justify Self End โ€‹

The .justify-self-end class sets the justify-self property to end, aligning the individual grid item along the inline (row) axis at the end.

html
<div class="grid grid-cols-3  justify-items-stretch gap-s">
  <div class="[...]">1</div>
  <div class="[...] justify-self-end">2</div>
  <div class="[...]">3</div>
  <div class="[...]">4</div>
  <div class="[...]">5</div>
  <div class="[...]">6</div>
</div>
1
2
3
4
5
6

Justify Self Stretch โ€‹

The .justify-self-stretch class sets the justify-self property to stretch, allowing the individual grid item to stretch along the inline (row) axis.

html
<div class="grid grid-cols-3  justify-items-stretch gap-s">
  <div class="[...]">1</div>
  <div class="[...] justify-self-stretch">2</div>
  <div class="[...]">3</div>
  <div class="[...]">4</div>
  <div class="[...]">5</div>
  <div class="[...]">6</div>
</div>
1
2
3
4
5
6

Justify Self Auto โ€‹

The .justify-self-auto class sets the justify-self property to auto, allowing the individual grid item to size and position itself based on its content.

html
<div class="grid grid-cols-3  justify-items-stretch gap-s">
  <div class="[...]">1</div>
  <div class="[...] justify-self-auto">2</div>
  <div class="[...]">3</div>
  <div class="[...]">4</div>
  <div class="[...]">5</div>
  <div class="[...]">6</div>
</div>
1
2
3
4
5
6