<body>
<main class="main">
<div class="group group1">그룹1</div>
<div class="group group2">그룹2</div>
<div class="group group3">그룹3</div>
</main>
</body>
.main {
box-sizing: border-box;
width: 940px;
margin: 0 auto;
background: blue;
min-height: 400px;
display: flex;
flex-flow: row nowrap;
justify-content: space-between;
padding: 30px;
}
참고 영상
https://www.youtube.com/watch?v=xara4Z1b18I
여기서 그룹1을 float:left 시키면 어떻게 될까?
마치 그룹1 옆에 그룹2가 붙은 것처럼 보인다. 하지만 그룹1 요소는 normal flow를 벗어나 한 층 위로 떠있는 상태이며, 그룹1이 차지하고 있던 자리가 비었기 때문에 그룹2가 채우고 있는 상태이다.
그룹1의 배경색을 지우면 더 이해가 쉽다.
→그룹2는 normal flow에 위치하고 있지만 그룹1이 차지하고 있는 width의 길이 때문에 그룹2의 텍스트가 옆에 위치해있는 것 뿐 그룹2가 오른쪽으로 옮겨진 것이 아니다.
→ 그룹2의 텍스트가 옆으로 옮겨지는 것이 아니라 밑으로 내려오는 것을 확인할 수 있다.