The align-items property defines the default alignment for items inside a flexbox or grid container. In a flexbox container, the items are aligned along the cross axis, which is vertical by default. In a grid container, items are aligned along the block axis. For this property to have any alignment effect, the items must have available space around them in the relevant direction.
| baseline | Elements are positioned at the baseline of the container. | See example |
|---|---|---|
| center | Items are positioned at the center of the container. | See example |
| end | Items are positioned at the end of their individual grid cells in the block direction. | See example |
| flex-end | Items are positioned at the end of the container. | See example |
| flex-start | Items are positioned at the beginning of the container. | See example |
| inherit | Inherits the property from the parent element. | See example |
| initial | Sets to the default value. | See example |
| normal | Behaves as stretch for flexbox and grid elements. | See example |
| start | Items are positioned at the start of their individual grid cells in the block direction. | See example |
| stretch | Items are stretched to fit the container. | See example |
Specifies alignment for items within a flexible container.
Thank you for visiting! Adding privacy policy.
© 2024 All rights reserved.
Vam je koda pomagala? Če želite podpreti moj trud pri pripravi vodičev in vzdrževanju strani, mi lahko namenite donacijo za kavo.