Align items
←Use the Flexbox item alignment helper class to position the Flexbox childs on the secondary axis (cross axis). This will set the CSS property align-items
.
Are you getting confused by the differnt alignment methods with Flexbox? Don’t bother too much! You are not alone. The axis concept in Flexbox is puzzeling. These methods will be there when you’ll need them.
Syntax:
.items-{alignment}
SCSS:
_flex-align-items.scss
.items-stretch
.box
.box
.box
↑ Stretched items take all the place. Will not work with gapped flexboxes, as those need to be nested and the strechting only applis to the first child.
.items-end
.box
.box
.box
↑ Items aligned on the end of the secondary axis.
.items-center
.box
.box
.box
↑ Items aligned in the middle of the secondary axis.