Justify items
The justify items class sets the justify-items property. It controls how individual items are aligned along the inline (row) axis within their grid areas. It determines the horizontal positioning of content inside each grid cell.
justify-items is ignored, so it has no effect.| CSS Shortcut class | Applied style |
|---|---|
|
|
|
|
|
|
|
|
Examples
Centre
justify-items-center
These items are centred horizontally within their grid areas along the inline axis.
1
2
3
<div class="d-grid grid-cols-3 justify-items-center">
<p>1</p>
<p>2</p>
<p>3</p>
</div>
Stretch
justify-items-stretch
These items stretch to fill the entire width of their grid areas along the inline axis (default behavior).
1
2
3
<div class="d-grid grid-cols-3 justify-items-stretch">
<p>1</p>
<p>2</p>
<p>3</p>
</div>
Start
justify-items-start
These items align to the start edge of their grid areas along the inline axis.
1
2
3
<div class="d-grid grid-cols-3 justify-items-start">
<p>1</p>
<p>2</p>
<p>3</p>
</div>
End
justify-items-end
These items align to the end edge of their grid areas along the inline axis.
1
2
3
<div class="d-grid grid-cols-3 justify-items-end">
<p>1</p>
<p>2</p>
<p>3</p>
</div>
xs:> 480pxsm:> 640pxmd:> 768pxlg:> 1024pxxl:> 1280px
<div class="xs:justify-items-center ...">
...
</div>