Bootstrap 6 Justify Items

Justify items

Set the inline-axis alignment for every item in a grid container, or override it for one.

ClassStyles
.justify-items-startjustify-items: start;
.justify-items-endjustify-items: end;
.justify-items-centerjustify-items: center;
.justify-items-stretchjustify-items: stretch;
.justify-self-startjustify-self: start;
.justify-self-endjustify-self: end;
.justify-self-centerjustify-self: center;

Justify items

.justify-items-{start|end|center|stretch} sets the inline-axis alignment for every item in the container.

1
2
3
html
<div class="d-grid grid-cols-3 justify-items-center gap-3">
  <div>1</div>
  <div>2</div>
  <div>3</div>
</div>

Justify self

.justify-self-{start|end|center} overrides that alignment for one item.

1
Pushed to the end
3
html
<div class="d-grid grid-cols-3 justify-items-start gap-3">
  <div>1</div>
  <div class="justify-self-end">Pushed to the end</div>
  <div>3</div>
</div>

Customizing

Utilities API

Justify items utilities are declared in our utilities API in scss/_utilities.scss. Learn how to use the utilities API.

scss
"justify-items": (
  responsive: true,
  property: justify-items,
  values: (
    start: start,
    end: end,
    center: center,
    stretch: stretch,
  )
),
"justify-self": (
  responsive: true,
  property: justify-self,
  values: (
    start: start,
    end: end,
    center: center,
  )
),
"place-items": (
  responsive: true,
  property: place-items,
  values: (
    start: start,
    end: end,
    center: center,
    stretch: stretch,
  )
),