Align Items
Utilities for controlling how flex and grid items are positioned along a container’s cross axis.
Use to stretch items to fill the container’s cross axis:
Start
Use items-start
to align items to the start of the container’s cross axis:
<div class="flex items-start ...">
<div class="py-4">01</div>
<div class="py-12">02</div>
<div class="py-8">03</div>
</div>
Use to align items along the center of the container’s cross axis:
End
Use items-end
to align items to the end of the container’s cross axis:
<div class="py-4">01</div>
<div class="py-12">02</div>
<div class="py-8">03</div>
</div>
Hover, focus, and other states
Tailwind lets you conditionally apply utility classes in different states using variant modifiers. For example, use hover:items-center
to only apply the items-center
utility on hover.
<div class="flex items-stretch hover:items-center">
<!-- ... -->
</div>
For a complete list of all available state modifiers, check out the documentation.
You can also use variant modifiers to target media queries like responsive breakpoints, dark mode, prefers-reduced-motion, and more. For example, use md:items-center
to apply the utility at only medium screen sizes and above.