align-items[row]
align-items [row]
So justify-content controls how items are laid out on the main axis. What about their layout in the cross axis? Don't worry, that's where align-items come into play. Remember the cross axis is always perpendicular to the main axis. So if the main axis is sitting horizontally, where flex-direction is row. Then , the cross axis is sitting vertically. 🤓
The align-items property is used to align the flex items.
The center value aligns the flex items in the middle of the container:
The flex-start value aligns the flex items at the top of the container:
The flex-end value aligns the flex items at the bottom of the container:
The stretch value stretches the flex items to fill the container (this is default):
The baseline value aligns the flex items such as their baselines aligns:
Last updated