Browse documentation

Reference / Flexbox & grid

Justify items

Align every grid item within its own track on the inline axis.

Working example

Centering the items preserves each label’s intrinsic width. The tracks still occupy their normal share of the grid.

HTML
<div class="grid grid-cols-2 justify-items-center gap-3 border p-2">
  <span class="bg-neutral-200 px-2">North</span>
  <span class="bg-neutral-200 px-2">South</span>
</div>

Class reference

ClassCSS declarations
justify-items-startjustify-items: start;
justify-items-centerjustify-items: center;
justify-items-endjustify-items: end;
justify-items-baselinejustify-items: baseline;
justify-items-stretchjustify-items: stretch;
View full generated CSS
Compiled CSS
.justify-items-baseline {
  justify-items: baseline;
}
.justify-items-center {
  justify-items: center;
}
.justify-items-end {
  justify-items: end;
}
.justify-items-start {
  justify-items: start;
}
.justify-items-stretch {
  justify-items: stretch;
}