The align-items property lines up every direct child inside its flex line or grid area. In a row flex, that is the vertical position: items move up, down, or stretch inside that one line.
One line is enough. align-self on a single child overrides the group. This property does not pack extra lines. Use align-content for that.
Standard-track.
Not deprecated and not experimental. Flex and grid values are widely supported. anchor-center is newer and only applies to anchor-positioned boxes.
Ask for stretch.align-items: stretch is also what normal does for flex items, so this is the default look.
Leave height alone. The divs have no height, so the cross size is auto and stretch is allowed to grow them.
Fill the line. Each box grows to the 120px line. The item border is there so you can see the box, not only the word.
Text stays at the start of the box. Stretch changes the box size. It does not vertically center the word inside that box.
Edge Cases & Pitfalls
If the items do not move, one of these is usually why.
height
stretch loses to a fixed cross size
A height on a row item, or a width on a column item, blocks stretch. The item then packs like flex-start.
lines
align-content is a different job
align-content moves wrapped lines. align-items moves items inside a line. You do not need flex-wrap for align-items.
self
One child can override the group
align-self on an item replaces align-items for that item. The others stay with the container.
axis
A column flex flips the axis
With flex-direction: column, align-items is horizontal. center then centers items left to right, and you need spare width to see it.
safe
center can overflow both ways
If an item is taller than the line, center overflows equally above and below. safe center falls back to start when that overflow would hide content.
Compatibility
Browser Support
align-items is a browser layout property for flex and grid. Node.js, Deno, and Bun do not apply it.
✓ Baseline · Flex since 2015
align-items
Flex: Chrome 29+, Firefox 28+, Safari 9+, Edge 12+. Grid: Chrome 57+, Firefox 52+, Safari 10.1+, Edge 16+. Internet Explorer 11 is flex-only.
96%Flex and grid support
Google Chrome29+ flex · 57+ grid
Full support
Mozilla Firefox28+ flex · 52+ grid
Full support
Apple Safari9+ flex · 10.1+ grid
Full support
Microsoft Edge12+ flex · 16+ grid
Full support
Opera16+ flex · grid in Chromium 57+
Full support
Samsung Internet4+ flex · 6.2+ grid
Full support
Internet Explorer11 · Old flex only
Partial
align-itemsWidely supported
Bottom line: Safe for flex and grid in current browsers. Internet Explorer 11 is flex-only, and a centered column item can overflow its container there. anchor-center needs Chrome 125, Safari 26, or Firefox 147, and only affects anchor-positioned boxes. safe needs Chrome 115, Firefox 63, or Safari 17.6.
Remember
Key Takeaways
Role: line up every direct child inside its flex line or grid area.
Row flex: the cross axis is vertical. One line is enough. Give the row a height to see it.
Not align-content: content moves lines. Items moves the items inside a line.
Default:normal stretches flex items whose cross size is auto. It is not inherited.
One line:align-items places each item inside the line — center, end, or stretch — without touching how the lines themselves are packed.
Frequently Asked Questions
It sets how every direct child lines up inside its flex line or grid area, on the cross axis. In a row flex, that is the vertical position. It does not move the lines themselves.
align-items moves items inside one line. align-content moves the lines when there is more than one and the container has spare space. A single row can use align-items without flex-wrap.
Stretch only grows an item whose cross size is auto. A set height on a row item, or a set width on a column item, blocks it. The item then falls back to flex-start.
Yes. In a grid it aligns each item inside its grid area on the block axis. The default normal behavior is similar to stretch, except some replaced boxes and items with an aspect ratio start at the start edge instead.
Yes. align-self on that item replaces the group value from align-items. The other items keep the container's alignment.
Flex support is in Chrome 29+, Firefox 28+, Safari 9+, and Edge 12+. Grid support starts at Chrome 57, Firefox 52, and Safari 10.1. Internet Explorer 11 only has the old flex behavior. It is a browser layout property, not a Node.js feature.