Coding task · HTML and CSS course · Module 4: Flexbox

Centering with align-items

The align-items property controls the alignment of elements along the cross axis. Key values include: stretch (default, stretches items), flex-start (aligns to the start of the axis), flex-end (aligns to the end of the axis), center (centered), baseline (aligned to the text baseline). It works perpendicular to justify-content.

Task

Create a flex container with a fixed height and use align-items: center to vertically center the elements.