Specifies the default alignment for items inside the flexible container.
Explain the syntax of this reference item and show an example in the code block below. Try to remove as much unnecessary items as possible. It’s important this is easy to process at a glance.
/*
div {
display: flex;
align-items: center;
}
*/
flex-start
items are positioned at the beginning of the container
flex-end
items are positioned at the end of the container
baseline
items are positioned at the baseline
initial
sets the property to its default value
inherit
inherits this property from its parent element
stretch
items stretch to fit the container
center
items are positioned in the center of the container
Have a code example of align-items
? Submit a codepen.io demo and we'll showcase it here ↴