Flexbox Examples

Example 5

This example uses: justify-content: space-between to spread the two flex items to the left and right margins.

1
2
CSS
.flex-container {
    display: flex;
    justify-content: space-between;
    background-color: indianred;
}

.flex-container > div {
    background-color: powderblue;
    margin: 10px;
    padding: 20px;
    font-size: 30px;
}
    
HTML

<div class="flex-container">
    <div>1</div>
    <div>2</div>
    <div>3</div>
</div>