Browse documentation
Reference / Flexbox & grid
Place items
Set both alignment axes for all items in a grid without repeating separate align and justify utilities.
Working example
A-side
B-side
Place-items-center centers each item in its own cell, including when the cells have different sizes.
<div class="grid h-24 grid-cols-2 place-items-center border">
<span class="border p-2">A-side</span>
<span class="border p-2">B-side</span>
</div>Class reference
| Class | CSS declarations |
|---|---|
place-items-start | place-items: start; |
place-items-center | place-items: center; |
place-items-end | place-items: end; |
place-items-baseline | place-items: baseline; |
place-items-stretch | place-items: stretch; |
View full generated CSS
.place-items-baseline {
place-items: baseline;
}
.place-items-center {
place-items: center;
}
.place-items-end {
place-items: end;
}
.place-items-start {
place-items: start;
}
.place-items-stretch {
place-items: stretch;
}