- flex-wrap은 아이템들의 가로 크기 합이 콘테이너의 가로 크기를 넘어갈 때 어떻게 처리할지를 정합니다.
- 기본값은 nowrap로...
<!doctype html>
<html lang="ko">
<head>
<meta charset="utf-8">
<title>CSS</title>
<style>
* {
box-sizing: border-box;
}
.jb-container {
height: 400px;
background-color: #01579b;
display: flex;
flex-wrap: nowrap;
}
.jb-item:nth-child(1) {
background-color: #ffebee;
}
.jb-item:nth-child(2) {
background-color: #ffcdd2;
}
.jb-item:nth-child(3) {
background-color: #ef9a9a;
}
.jb-item:nth-child(4) {
background-color: #e57373;
}
</style>
</head>
<body>
<div class="jb-container">
<div class="jb-item">Item 1</div>
<div class="jb-item">Item 2</div>
<div class="jb-item">Item 3</div>
<div class="jb-item">Item 4</div>
</div>
</body>
</html>

- 아이템의 가로 크기를 늘려도 한 줄에 나오도록 크기를 조정합니다.
.jb-item {
width: 30%;
}

- flex-wrap의 값을 wrap으로 정하면, 아이템을 다음 줄로 넘깁니다.
.jb-container {
height: 400px;
background-color: #01579b;
display: flex;
flex-wrap: wrap;
}

- flex-wrap의 값을 wrap-reverse로 정하면, 아이템을 이전 줄로 넘깁니다.
.jb-container {
height: 400px;
background-color: #01579b;
display: flex;
flex-wrap: wrap-reverse;
}

- flex-direction의 값이 column일 때 flex-wrap의 값을 wrap으로 정하면, 오른쪽으로 넘깁니다.
.jb-container {
height: 400px;
background-color: #01579b;
display: flex;
flex-direction: column;
flex-wrap: wrap;
}
.jb-item {
height: 30%;
}
