<body>
<h2>๋ถ์ ์์ฑ ์์๋ณด๊ธฐ</h2>
<p>
๋นํ๊ธฐ๊ฐ ํ๋์ ๋จ๊ฑฐ๋ ๋ฐฐ๊ฐ ๋ฌผ ์์ ๋จ๋ฏ ์์๋ฅผ ๋์ฐ๋ ์์ฑ์ ๋ถ์ ์์ฑ์ด๋ผ ํฉ๋๋ค.
<br>๋ํ๋ถ์ ์์ฑ์ผ๋ก float์ position์ด ์์ต๋๋ค. ์ด ๋์ ์ฑ์ง์ ๋น์ทํ๋ฉด์๋ ๋ค๋ฅด๊ธฐ ๋๋ฌธ์ ๋ชฉ์ ์ ๋ฐ๋ผ ๋ช
ํํ๊ฒ ์ฌ์ฉํด์ผ ํฉ๋๋ค.
</p>
<hr>
<h3>float: ;</h3>
<p>
float๋ ์์์ ์๋๋ก ์ ๋ ฌ๋ ๋ธ๋ญ์์๋ฅผ ๋ถ์ ์์ผ ์ผ์ชฝ, ์ค๋ฅธ์ชฝ์ผ๋ก ์ ๋ ฌ๋ฐฉํฅ๋ฅผ ๊ฒฐ์ ํ ์ ์์ต๋๋ค.
<br>float๊ฐ ์ ์ฉ๋ ๋ธ๋ญ๋ ๋ฒจ์ ๊ฒฝ๊ณ๋ฐ์ค๋ฅผ ํด์ ํ๊ฒ ๋ฉ๋๋ค.
<br>์ฆ, margin๊ฐ์ ๋ํ์ฌ auto ๊ฐ์ ์ฌ์ฉํ ์ ์๊ฒ ๋ฉ๋๋ค.
</p>
<div class="box fr"></div>
<div class="box fl"></div>
</body>
<style>
/* ํ์ ์์์ค ํ๋๊ฐ ๋ถ์ ์์ฑ์ด ์ง์ ๋์๋ค๋ฉด ๋๋จธ์ง ์์๋ ๋ถ์ ์์ฑ์ด ์ ์ฉ๋์ด์ผ ํฉ๋๋ค. */
.box{
width: 200px; height: 200px;
background-color: #f90;
}
.fl{
/* user agent : none */
float: none;
/* ์ ๋ ฌ์ ์ฐ์ ์ด ์์ชฝ์ด ์๋ ์ผ์ชฝ์ ์ฐ์ ์ผ๋ก ์ ๋ ฌ๋จ */
float: left;
/* ์ ๋ ฌ์ ์ฐ์ ์ด ์์ชฝ์ด ์๋ ์ค๋ฅธ์ชฝ์ ์ฐ์ ์ผ๋ก ์ ๋ ฌ๋จ */
float: right;
float: none;
margin: 0 auto;
float: right;
}
.fr{
float: left;
}
</stlye>
<body>
<div class="hdr_wrap">
<div class="header">
<div class="logo"><b>LOGO</b>HERE</div>
<div class="nav">Navigation Bar</div>
</div>
</div>
<div class="main"></div>
</body>
<style>
div.hdr_wrap{
background-color: #f90;
padding: 20px 0;
}
div.header{
overflow: hidden;
margin: 0 auto;
width: 1080px;
}
div.header>.logo{
font-family: 'Noto Sans KR', sans-serif;
font-size: 16px;
line-height: 40px;
color: #000;
float: left;
}
div.header>.nav{
font-family: 'Noto Sans KR', sans-serif;
font-weight: 700;
font-size: 14px;
line-height: 40px;
color: #000;
float: right;
}
div.main{
height: 480px;
background-color: #ccc;
}
</style>