Flexbox Flashcards
display: flex
container property
Defines a flex container
flex-direction
container property
row - (default, left to right)
row-reverse - right to left
column - top to bottom
column-reverse - bottom to top
flex-wrap
container property
nowrap - default, all items will be on one line
wrap - will wrap onto multiple lines from top to bottom
wrap-reverse - will wrap onto multiple lines bottom to top
flex-flow
container property
shorthand for flex-direction and flex wrap
default value is flex-flow: row nowrap
justify-content
container property
aligns along main axis
flex-start - packed to start of flex-direction
flex-end - packed to end of flex direction
center - items centered along the line
space-around - itmes evenly distributed with equal space around them
space-between - items evenly distributed, first item on start line, last item on end line
align-items
container property
aligns along the cross axis
stretch - default, stretch to fill the container (respecting min-width/max-width)
flex-start - placed at start of cross axis
flex-end - placed at end of cross axis
center - centered on the cross axis;
baseline - aligned so bases are aligned
align-content
container property
Aligns content along the cross axis, like justify content
Only works with flex-wrap: wrap
flex-start, flex-end, center, space-between, space-around, stretch
gap, row-gap, column-gap
container property
controls the space between items
does not control outer edges
align-self
children property
overrides default alignment for individual flex-items
flex-start, flex-end, center, baseline, stretch
order
children property
controls the order in which flex items appear
flex-grow
children property
takes a unitless number
dtermines the amount of available space in the flex container an item will take up
flex-shrink
children property
definies ability for a flex item to shrink if necessary
takes a unitless number
flex-basis
children property
defines the default size of an element
can be lenght or keyword
flex
children property
Shorthand for flex-grow, flex-shrink, flex-basis
e.g. flex: 2 1 30em;
flex-flow
container property
Shorthand for flex-direction and flex-wrap
e.g. flex-flow: row wrap
place-content
container property
Shorthand for align-content and justify-content
e.g. place-content: center flex-end
(aligns content center, and justifies content flex end)