Place items
place-items property. It is a shorthand for setting the cross axis and the main axis. It controls how items are aligned inside their grid areas along both axes in a grid container. justify-items is ignored, so place-items has no effect.| CSS Shortcut class | Applied style |
|---|---|
| |
| |
| |
| |
Examples
Centre
place-items-center
1
2
3
4
5
6
<div class="d-grid grid-cols-3 place-items-center">
<p>1</p>
<p>2</p>
<p>3</p>
<p>4</p>
<p>5</p>
<p>6</p>
</div> Stretch
place-items-stretch
1
2
3
4
5
6
<div class="d-grid grid-cols-3 place-items-stretch">
<p>1</p>
<p>2</p>
<p>3</p>
<p>4</p>
<p>5</p>
<p>6</p>
</div> Start
place-items-start
1
2
3
4
5
6
<div class="d-grid grid-cols-3 place-items-start">
<p>1</p>
<p>2</p>
<p>3</p>
<p>4</p>
<p>5</p>
<p>6</p>
</div> End
place-items-end
1
2
3
4
5
6
<div class="d-grid grid-cols-3 place-items-end">
<p>1</p>
<p>2</p>
<p>3</p>
<p>4</p>
<p>5</p>
<p>6</p>
</div> xs:> 480pxsm:> 640pxmd:> 768pxlg:> 1024pxxl:> 1280px
<div class="xs:place-items-center ...">
...
</div>