Browse documentation
Reference / Flexbox & grid
Justify items
Align every grid item within its own track on the inline axis.
Working example
North
South
Centering the items preserves each label’s intrinsic width. The tracks still occupy their normal share of the grid.
<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
| Class | CSS declarations |
|---|---|
justify-items-start | justify-items: start; |
justify-items-center | justify-items: center; |
justify-items-end | justify-items: end; |
justify-items-baseline | justify-items: baseline; |
justify-items-stretch | justify-items: stretch; |
View full generated 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;
}