Flexbox & Grid
Utilities for controlling how flex and grid items are positioned along a container's cross axis.
Class | Styles |
---|---|
items-start | align-items: flex-start; |
items-end | align-items: flex-end; |
items-center | align-items: center; |
items-baseline | align-items: baseline; |
items-stretch | align-items: stretch; |
Use items-stretch
to stretch items to fill the container's cross axis:
Use items-start
to align items to the start of the container's cross axis:
Use items-center
to align items along the center of the container's cross axis:
Use items-end
to align items to the end of the container's cross axis:
Use items-baseline
to align items along the container's cross axis such that all of their baselines align:
Prefix an align-items
utility with a breakpoint variant like md:
to only apply the utility at medium screen sizes and above:
<div class="flex items-stretch md:items-center ..."> <!-- ... --></div>
Learn more about using variants in the variants documentation.