Flex Container
.flex-container {
display: flex;
background-color: orange;
width:250px;
}
.flex-container > div {
background-color: yellow;
margin: 4px;
padding: 5px 10px;
font-size: 30px;
color:black;
}
div class="flex-container"
div 1 div
div 2 div
div 3 div
div
- display: flex;
- flex-direction: column;
- flex-direction: row;
- flex-direction: column-reverse;
- flex-direction: row-reverse;
- flex-wrap: wrap;
- flex-wrap: nowrap;
- flex-wrap: wrap-reverse;
- flex-flow: row wrap;
- justify-content: center;
- justify-content: flex-start;
- justify-content: flex-end;
- justify-content: space-around;
- justify-content: space-between;
- align-items: center;
- align-items: flex-start;
- align-items: flex-end;
- align-items: stretch;
- align-items: baseline;
- align-content: space-between;
- align-content: space-around;
- align-content: stretch;
- align-content: center;
- align-content: flex-start;
- align-content: flex-end;
Div center top-botttom & left-right
.flex-container {
display: flex;
justify-content: center;
align-items: center;
height: 300px;
background-color: orange;
}
.flex-container > div {
background-color: #f1f1f1;
color: white;
width: 100px;
height: 100px;
}