![]() |
VOOZH | about |
Bootstrap 5 Flex Align items to change the alignment of flex items on the cross-axis using align-items classes. The CSS align-items property sets the distribution of space between and around content items along a flexbox's cross-axis or a grid's block axis.
Bootstrap 5 Flex Align items classes:
| CSS Class | Description |
|---|---|
| align-items-** | Aligns the items to the ** position of the cross-axis. |
| align-items-*-** | Aligns the items to the ** position of the cross-axis for various (*) screen sizes. |
Note: '*' can be replaced by sm/md/lg/xl/xxl and ** can replace the "start", "end", "center", "baseline", "stretch"
Syntax:
<div class="d-flex align-items-start flex-row" ...>
<div class="border bg-light">
...
</div>
</div>
Example 1: In this example, we change the alignment of items to the start and the end of the cross-axis using align-items classes.
Output:
Example 2: In this example, we change the alignment of items to the center and the stretch of the cross-axis using align-items classes.
Output: