flex box Flashcards
display: flex;
turns container into flex container
main axis
x-axis
cross axis
y-axis
what are child elements called of flex container
flex items
flex-direction
sets main axis
flex-wrap
controls whether items should wrap or not when they exceed containers width
allows items to appear on multiple lines
justify-content
aligns items along main axis
align-items
aligns items along cross axis
align-content
aligns multiple lines of items along cross axis
align-self
overrides the default or assigned (with align-items) alignment for an individual item in a flex container
flex-grow
controls how much a flex item should grow relative to the other items when there is available space
flex-shrink
controls how much a flex item should shrink relative to the other items when there is not enough space
flex-basis
default size of flex item before any growing or shrinking
flex
flex-grow flex-shrink flex-basis
1 2 100px
center an item
display: flex;
justify-content: center;
align-items: center;