Flexbox Cheatsheet-1
Flexbox Cheatsheet-1
Container
display flex-direction
Establishes the main axis.
Enables flex for all children.
display: inline-flex;
flex-direction: row-reverse;
flex-direction: column;
flex-direction: column-reverse;
flex-wrap justify-content
Wraps items if they can't all be Attempts to distribute extra space on the main
made to fit on one line. axis.
justify-content: flex-end;
flex-wrap: wrap;
justify-content: center;
justify-content: space-around;
justify-content: space-evenly;
align-items align-content
Determines how items are laid out Only has an effect with more than one
on the cross axis. line of content. Examples shown here use
flex-wrap.
align-content: flex-end;
align-items: flex-end;
align-content: center;
align-items: center;
align-content: space-between;
align-items: baseline;
align-content: space-around;
align-items: stretch;
align-content: stretch;
Children
order flex-grow
Allows you to determine how each child is
Allows you to explictly set the
allowed to grow as a part of a whole.
order you want each child to
appear in.
flex-grow: 1;
order: 1;
flex-grow: 1, 2, 3;
flex-basis
Defines the size of an element
before remaining space is
distributed.