You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
flex-direction: row;/* Default, wherein the main axis goes from left to right, cross axis from top to bottom. */flex-direction: column;/* Main axis goes from top to bottom. */flex-direction: row-reverse;flex-direction: column-reverse;
min-height:100vh;/*Givin it height > contents is necessary else the container will end as soon as items are enclosed.*/flex-direction: column;/*change main axis from top to bottom*/justify-content: center;/*now the divs are aligned vertically in the center*/
Flex-alignment with align-items
Works on containers
Works on cross axis(!important point to notice) cos align-items:center wont work on main axis.
align-items: stretch;/*default*/align-items: center;/*this aligns the item across the cross axis, not the main axis, so give container some height*/height:100vh;/*Without height it wont be able to center across the cross axis.*/align-items: flex-end;align-items: baseline;/*will align to the base of the text in each box*/
Flex-alignment with align-contents
Works on containers
Works only on cross axis
Removes previously defined heights on boxes
needs wrap
flex-wrap: wrap;/*align content requires wrap around to work*/align-content: stretch;/*default*/align-content: flex-start;align-content: flex-end;align-content: space-between;align-content: space-around;align-content: center;