Align items
align-items property. It controls how items are aligned along the cross axis of a flex or grid container. flex-direction property sets the main and cross axis. The effects of align-items change based on the container's direction.| CSS Shortcut class | Applied style |
|---|---|
| |
| |
| |
| |
| |
Examples
Baseline
align-items-baseline
In column layouts, the alignment is horizontal.
1
2
3
<div class="d-flex align-items-baseline">
<p>1</p>
<p class="pb-800">2</p>
<p class="pt-900">3</p>
</div> Centre
align-items-center
In column layouts, there’s equal space to the left and right.
1
2
3
<div class="d-flex align-items-center">
<p>1</p>
<p>2</p>
<p>3</p>
</div> Stretch
align-items-stretch
In column layouts, they fill horizontal space unless a fixed size is set.
1
2
3
<div class="d-flex align-items-stretch">
<p>1</p>
<p>2</p>
<p>3</p>
</div> Start
align-items-start
In column layouts, they’re aligned to the left of the container.
1
2
3
<div class="d-flex align-items-start">
<p>1</p>
<p>2</p>
<p>3</p>
</div> End
align-items-end
In column layouts, they’re aligned to the right of the container.
1
2
3
<div class="d-flex align-items-end">
<p>1</p>
<p>2</p>
<p>3</p>
</div> xs:> 480pxsm:> 640pxmd:> 768pxlg:> 1024pxxl:> 1280px
<div class="xs:align-items-center ...">
...
</div>