6-5. CSS 3๋จ ๋ ์ด์์ ๋ง๋ค๊ธฐ_์ฐ์ต๋ฌธ์ 1,2
2021. 10. 12. 23:17ใHTML + CSS + JS
728x90
* ์ฐ์ต๋ฌธ์ 1
html
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<title>CSS ๋ ์ด์์ - 2๋จ ๋ ์ด์์</title>
<link rel="stylesheet" href="css/2column.css">
</head>
<body>
<div id="container">
<header id="header">
<h1>์ฌ์ดํธ ์ ๋ชฉ</h1>
</header>
<aside id="sidebar">
<h2>์ฌ์ด๋๋ฐ</h2>
</aside>
<section id="contents">
<h2>๋ณธ๋ฌธ</h2>
</section>
<footer id="footer">
<h2>ํธํฐ</h2>
<footer>
</div>
</body>
</html>
CSS
* {
margin:0;
padding:0;
box-sizing: border-box;
}
#container {
width: 1200px;
margin: 20px auto;
}
#header {
width: 100%;
height: 120px;
background-color: #acacac;
}
#sidebar {
width: 300px;
height: 600px;
background-color: #e9e9e9;
float: left;
}
#contents {
width: 900px;
background-color: #f7f7f7;
height: 600px;
float: left;
}
#footer {
clear: left;
width: 100%;
height: 100px;
background-color: #888888;
}
* ์ฐ์ต๋ฌธ์ 2
html
<!DOCTYPE html>
<html lang="ko">
<head>
<title>CSS ๋ ์ด์์ - 3๋จ ๋ ์ด์์</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="css/3column.css">
</head>
<body>
<div id="container">
<header id="header">
<h1>์ฌ์ดํธ ์ ๋ชฉ</h1>
</header>
<aside id="left-sidebar">
<h2>์ฌ์ด๋๋ฐ</h2>
</aside>
<section id="contents">
<h2>๋ณธ๋ฌธ</h2>
</section>
<aside id="right-sidebar">
<h2>์ฌ์ด๋๋ฐ</h2>
</aside>
<footer id="footer">
<h2>ํธํฐ</h2>
<footer>
</div>
</body>
</html>
CSS
* {
margin:0;
padding:0;
box-sizing: border-box;
}
#container {
width: 1200px;
margin: 20px auto;
}
#header {
width: 100%;
height: 120px;
background-color: #acacac;
}
#left-sidebar {
width: 250px;
height: 600px;
float: left;
background-color:#e9e9e9;
}
#contents {
width: 800px;
height: 600px;
float: left;
background-color:#f7f7f7;
}
#right-sidebar {
width: 150px;
height: 600px;
float: left;
background-color:#e9e9e9;
}
#footer {
clear: left;
width: 100%;
height: 100px;
background-color: #888888;
}
728x90
'HTML + CSS + JS' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
6-7. CSS ๊ธฐ์ด ์ฐ์ต๋ฌธ์ 1,2,3 (0) | 2021.10.12 |
---|---|
6-6. ์น ์์ ์์น ์ ํ๋ ๋ฐฉ๋ฒ- position(static, relative, absolute, fixed) (0) | 2021.10.12 |
6-4. CSS ๋ ์ด์์ ๋ง๋ค๊ธฐ, display, float โญโญ (0) | 2021.10.12 |
6-3. CSS margin, padding (0) | 2021.10.12 |
6-2. CSS ํ ๋๋ฆฌ ์คํ์ผ box-style, border-width, border-color, border- radius (1) | 2021.10.12 |