align-items utilities control how flex or grid items align along the cross axis, perpendicular to the main axis. This lesson explains every align value and how per-item self-* overrides work.
What Does align-items Control?
items-* utilities map to the CSS align-items property, controlling how items align on the cross axis. In a flex-row container, that means vertical alignment; in a flex-col container, it means horizontal alignment.
items-center is one of the most frequently used Tailwind utilities overall, since vertically centering content was historically one of the hardest problems in CSS before flexbox.
items-start/items-end align items to the beginning or end of the cross axis.
items-center centers items along the cross axis.
items-baseline aligns items by their text baselines, useful for mismatched font sizes.
items-stretch (the default) stretches items to fill the container's cross-axis size.
Align Items Cheatsheet
Cross-axis alignment values, plus per-item overrides.
Class
CSS
Effect
items-stretch
align-items: stretch
Items stretch to fill cross-axis space (default)
items-start
align-items: flex-start
Items align to the start of the cross axis
items-center
align-items: center
Items centered on the cross axis
items-end
align-items: flex-end
Items align to the end of the cross axis
items-baseline
align-items: baseline
Items align by text baseline
self-auto
align-self: auto
Item follows the container's align-items (default)
self-center
align-self: center
Overrides just this item to center
self-stretch
align-self: stretch
Overrides just this item to stretch
items-* vs self-*
items-* is set on the flex/grid container and applies to every child by default. self-* is set on an individual child and overrides the container's alignment for that one item only.
Every item defaults to items-center from the parent, except the two with their own self-* override.
The Vertical Centering Recipe
To center content both ways inside a box, regardless of the box's height, combine a fixed or flexible height with flex items-center justify-center. This single pattern replaces older CSS tricks involving absolute positioning and negative margins.
Aligning Mismatched Text Sizes With items-baseline
items-baseline is especially useful when a row mixes different font sizes, like a price and its currency label, and you want their text to sit on the same visual baseline instead of centering their full line-heights.
Confusing items-* (cross axis) with justify-* (main axis), especially after changing flex-direction.
Using items-center when items-baseline would produce cleaner text alignment for mismatched font sizes.
Forgetting the container needs a defined height (or flexible height like h-screen) for vertical centering to be visible.
Applying self-* on an element whose parent isn't a flex or grid container, which has no effect.
Assuming items-stretch (the default) will make all items equal height when a min-h-*/content constraint is actually needed too.
Key Takeaways
items-* utilities control cross-axis alignment for every child in a flex or grid container.
self-* utilities override alignment for a single child, independent of the container's items-* setting.
items-center combined with flex and a defined height solves vertical centering cleanly.
items-baseline aligns text by baseline, ideal for rows mixing different font sizes.
Cross-axis meaning flips between vertical and horizontal depending on flex-direction.
Pro Tip
Reach for flex items-center justify-center as your default recipe any time you need to center something, it works for text, images, icons, and entire modal dialogs alike.
You now understand Tailwind's align-items and self-align utilities. Next, learn Tailwind Grid for building two-dimensional layouts.