You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 16, 2026. It is now read-only.
In the previous exercise, you learned how to justify the content of a flex container from left to right across the page.
It is also possible to align flex items vertically within the container.
The align-items property makes it possible to space flex items vertically. .container { align-items: baseline; }
Below are five commonly used values for the align-items property:
flex-start — all elements will be positioned at the top of the parent container.
flex-end — all elements will be positioned at the bottom of the parent container.
center — the center of all elements will be positioned halfway between the top and bottom of the parent container.
baseline — the bottom of the content of all items will be aligned with each other.
stretch — if possible, the items will stretch from top to bottom of the container (this is the default value; elements with a specified height will not stretch; elements with a minimum height or no height specified will stretch).
In the previous exercise, you learned how to justify the content of a flex container from left to right across the page.
It is also possible to align flex items vertically within the container.
The align-items property makes it possible to space flex items vertically.
.container { align-items: baseline; }Below are five commonly used values for the align-items property:
flex-start — all elements will be positioned at the top of the parent container.
flex-end — all elements will be positioned at the bottom of the parent container.
center — the center of all elements will be positioned halfway between the top and bottom of the parent container.
baseline — the bottom of the content of all items will be aligned with each other.
stretch — if possible, the items will stretch from top to bottom of the container (this is the default value; elements with a specified height will not stretch; elements with a minimum height or no height specified will stretch).