overflow : hidden
집나간 자식 잡아 오는 것
clear : both
right, left 써도 되지만 좌우 관계 없이 편하게 both
box-sizing:border-box;
padding과 border를 기준으로 200px에 맞춘다
box-sizing:content-box;
content를 200px에 맞추므로 padding, border 부분은 더 커짐
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>RAAYYOUUT</title>
<style>
#con{
width: 600px;
height: 600px;
border: 1px solid gray;
margin: 0 auto;
overflow: hidden;
text-align: center;
}
#header{
width: 594px;
height: 50px;
line-height: 50px;
text-align: center;
border: 1px solid gray;
position: relative;
top: 2px;
left: 2px;
}
#nav{
width: 595px;
height: 90px;
text-align: center;
border: 1px solid gray;
float: left;
position: relative;
top: 5px;
left: 2px;
}
#content{
width: 399px;
height: 300px;
border: 1px solid gray;
text-align: center;
position: relative;
top: 100px;
left: 1px;
}
#banner{
width: 190px;
height: 300px;
border: 1px solid gray;
text-align: center;
position: relative;
left: 405px;
bottom: 202px;
}
#footer{
width: 594px;
height: 140px;
border: 1px solid gray;
text-align: center;
float: left;
position: relative;
bottom: 200px;
left: 1px;
}
p{
line-height: 20px;
text-align: center;
}
li{
float: left;
border: 1px solid gray;
width: 100px;
margin: 1px;
list-style: none;
}
ul{
align-items: center;
text-align: center;
}
</style>
</head>
<body>
<div id="con">
<div id="header">
HEADER
</div>
<div id="nav">
<p>NAVIGATION</p>
<ul>
<li>menu1</li>
<li>menu2</li>
<li>menu3</li>
<li>menu4</li>
<li>menu5</li>
</ul>
</div>
<div id="wrap">
<div id="content"> CONTENT </div>
<div id="banner"> BANNER </div>
</div>
<div id="footer">
FOOTER
</div>
</div>
</body>
</html>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
그외