<h1>nowrap(デフォルト)</h1>
<div class="container container-nowrap">
    <div class="item">1</div>
    <div class="item">2</div>
    <div class="item">3</div>
    <div class="item">4</div>
</div>

<h1>wrap</h1>
<div class="container container-wrap">
    <div class="item">1</div>
    <div class="item">2</div>
    <div class="item">3</div>
    <div class="item">4</div>
</div>

<h1>wrap-reverse</h1>
<div class="container container-wrap-reverse">
    <div class="item">1</div>
    <div class="item">2</div>
    <div class="item">3</div>
    <div class="item">4</div>
</div>
.container {
    width: 100px;
    display: flex;
}

.container-nowrap {
    flex-wrap: nowrap;
}

.container-wrap {
    flex-wrap: wrap;
}

.container-wrap-reverse {
    flex-wrap: wrap-reverse;
}

.item {
    width: 50px;
    height: 50px;
}

.item:nth-child(1) {
    background-color: #fff001;
}

.item:nth-child(2) {
    background-color: #00a5e7;
}

.item:nth-child(3) {
    background-color: #00984b;
}

.item:nth-child(4) {
    background-color: #cd5638;
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.