float에 관해 이해 안되는게 있어서 여쭤봅니다
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<div class="container">
<div class="header"></div>
<div class="left-menu"></div>
<div class="right"></div>
</div>
</body>
</html>
위에가 html 코드고
.left-menu {
width: 20%;
height: 400px;
background-color: cornflowerblue;
float: left;
}
.right {
width: 20%;
height: 400px;
background-color: coral;
float: left;
}
이게 css 코드인데요 (중요하지 않은건 제외)
.right에 float: left;를 달면

이렇게 잘 출력되는데 .right의 float: left;를 없애면

이렇게 사라집니다. 겹친거같은데
1. .left-menu에만 float: left; 달아도 .right를 가진 div태그가 옆에 나와야 되는거 아닌가요?
( div 두 개에 다 float를 지정해주어야 하는 이유 )
2. div태그말고 태그없이 그냥 글 쓰면 옆에 잘 나오는 이유가 뭔가요?