display
display: flex | inline-flex;
Defines a flex container; enables flex context for all its direct children.
HTML
<div class="container">
<div>Item 1</div>
<div>Item 2</div>
<div>Item 3</div>
</div>
CSS
.container {
display: flex;
}
flex-direction
flex-direction: row | row-reverse | column | column-reverse;
Defines the direction of the main axis.
HTML
<div class="container">
<div>Item 1</div>
<div>Item 2</div>
<div>Item 3</div>
</div>
CSS
.container {
display: flex;
flex-direction: column;
}
flex-wrap
flex-wrap: nowrap | wrap | wrap-reverse;
Controls whether flex items are forced onto one line or can wrap onto multiple lines.
HTML
<div class="container">
<div>Item 1</div>
<div>Item 2</div>
<div>Item 3</div>
<div>Item 4</div>
<div>Item 5</div>
</div>
CSS
.container {
display: flex;
flex-wrap: wrap;
}
justify-content
justify-content: flex-start | flex-end | center | space-between | space-around | space-evenly;
Aligns items along the main axis.
HTML
<div class="container">
<div>Item 1</div>
<div>Item 2</div>
<div>Item 3</div>
</div>
CSS
.container {
display: flex;
justify-content: space-between;
}
align-items
align-items: flex-start | flex-end | center | baseline | stretch;
Aligns items along the cross axis.
HTML
<div class="container" style="height: 200px;">
<div>Item 1</div>
<div>Item 2</div>
<div>Item 3</div>
</div>
CSS
.container {
display: flex;
align-items: center;
height: 200px;
}
align-content
align-content: flex-start | flex-end | center | space-between | space-around | stretch;
Aligns lines of items in a multi-line flex container.
HTML
<div class="container" style="height: 300px;">
<div>Item 1</div>
<div>Item 2</div>
<div>Item 3</div>
<div>Item 4</div>
<div>Item 5</div>
</div>
CSS
.container {
display: flex;
flex-wrap: wrap;
align-content: space-around;
height: 300px;
}