Professional Documents
Culture Documents
Flexbox Cheat Sheet 1: Flex-Wrap 1 2 3 4 5 6 7
Flexbox Cheat Sheet 1: Flex-Wrap 1 2 3 4 5 6 7
1 2 3
5 6 7
flex direction column
row Default behaviour of flexbox tries to fit the flex
items well within a single line. The flex-wrap
property enables us to wrap the items in the next
row-reverse
row or column.
column-reverse .container {
display: flex;
justify-content
The justify-content property aligns the flex items align-content
along the main axis.
of the flex items across the cross axis. This works only
For flex items in column, the justify-content when there are multiple lines of flex items.
property will align the item in the vertical direction.
flex-start flex-end
flex-start
flex-end
center stretch
center
space-between
space-around
space-between
space-around
.container {
display: flex;
flex-direction: flex-start | flex-end | center | space-between | space-around |
space-evenly;
space-evenly }
center stretch
baseline
.container {
display: flex;
flex-direction: stretch | flex-start | flex-end | center | baseline;
}
container.
center: Flex items are stacked at middle of the flex
container.
baseline: Flex items are aligned such that individual
baselines align at the same level. The baselines are
calculated by considering the size of the content inside the
container. In the above example, the baseline is taken with Copyright © 2021 by Devarsenal
respect to the text in individual items. All rights reserved. No part of this guide