Place content
place-content property. It is a shorthand for setting both cross axis and main axis. It controls how extra space is distributed between rows and columns in multi-line flex or grid containers. flex-direction property sets the main and cross axis. The effects of place-content change based on the container's direction.| CSS Shortcut class | Applied style |
|---|---|
| |
| |
| |
| |
| |
| |
| |
Examples
Around
place-content-around
1
2
3
4
5
6
<div class="d-grid grid-cols-3 place-content-around">
<p>1</p>
<p>2</p>
<p>3</p>
<p>4</p>
<p>5</p>
<p>6</p>
</div> Between
place-content-between
1
2
3
4
5
6
<div class="d-grid grid-cols-3 place-content-between">
<p>1</p>
<p>2</p>
<p>3</p>
<p>4</p>
<p>5</p>
<p>6</p>
</div> Evenly
place-content-evenly
1
2
3
4
5
6
<div class="d-grid grid-cols-3 place-content-evenly">
<p>1</p>
<p>2</p>
<p>3</p>
<p>4</p>
<p>5</p>
<p>6</p>
</div> Centre
place-content-center
1
2
3
4
5
6
<div class="d-grid grid-cols-3 place-content-center">
<p>1</p>
<p>2</p>
<p>3</p>
<p>4</p>
<p>5</p>
<p>6</p>
</div> Stretch
place-content-stretch
1
2
3
4
5
6
<div class="d-grid grid-cols-3 place-content-stretch">
<p>1</p>
<p>2</p>
<p>3</p>
<p>4</p>
<p>5</p>
<p>6</p>
</div> Start
place-content-start
1
2
3
4
5
6
<div class="d-grid grid-cols-3 place-content-start">
<p>1</p>
<p>2</p>
<p>3</p>
<p>4</p>
<p>5</p>
<p>6</p>
</div> End
place-content-end
1
2
3
4
5
6
<div class="d-grid grid-cols-3 place-content-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-content-center ...">
...
</div>