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

Place-items-center centers each item in its own cell, including when the cells have different sizes.

HTML
<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

ClassCSS declarations
place-items-startplace-items: start;
place-items-centerplace-items: center;
place-items-endplace-items: end;
place-items-baselineplace-items: baseline;
place-items-stretchplace-items: stretch;
View full generated CSS
Compiled 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;
}