align-items
The align-items
property is used to set a layout pattern of flex items (nested child elements) along the cross axis of the flex container. The cross axis is typically the vertical axis unless you set column
or column-reverse
in the flex-direction
property. We'll provide our explanation based on the default flex-direction
setting.
This property is effective when the flex items are placed only in one line. When the flex items are wrapped, you need to add the align-content
property, which will be explained in the next topic.
flex-start
This is the default setting. With this property value, flex items are laid out at the top edge of the parent element.
Note: 'edge' means the endpoint with some distance from the edge of the element based on the container's paddings and flex item's margins.
center
With this property value, flex items are laid out in the c
Subscribe now for
uninterrupted access.