์คํ๋ฅดํ์ฝ๋ฉํด๋ฝ ํํ์ด์ง ๋ฐ๋ก๊ฐ๊ธฐ ๐จ
Ctrl
+Alt
+L
๊ณผ Tab
ํค ์ฌ์ฉํ๊ธฐCtrl
+ /
๋๋ /**/
head
: ๋์ ๋ณด์ด์ง ์๋ ์์ญ๋ค!body
: ๋์ ๋ณด์ด๋ ์นํ์ด์ง ํ๋ฉด<head>
<style>
/*์ด ๊ณณ์ ๋ด์ฉ์ด ๋ค์ด๊ฐ๋ค!*/
</style>
</head>
๋ฐฐ๊ฒฝ : background-color, background-image, background-size, background-position
์ฌ์ด์ฆ : width, height
ํฐํธ : font-size, font-weight, font-family, color
(๊ตฌ๊ธ ์นํฐํธ โก [ select this style ]
โก ์ฐ์ธก์๋จ ๋ชจ์ ์์ด์ฝ โก Embed
โก linkํ๊ทธ ๋ณต์ฌํด์ <head>
๋ถ์ฌ๋ฃ๊ธฐ + CSS๋ณต์ฌํด์ <style>
๋ถ์ฌ๋ฃ๊ธฐ
๊ฐ๊ฒฉ : margin, padding
margin : ๋ฐ๊นฅ์ฌ๋ฐฑ
padding : ์์ชฝ์ฌ๋ฐฑ
๊ธ์จ : h1~h5
๊ธฐํ : border-radius
๊ฟํ ์ด๋ชจํฐ์ฝ ๋ชจ์
๋จ๋ค์ด ๋ง๋ค์ด ๋ ๊ฒ์ ์ ํ์ฉํ๊ธฐ โก ์ ์ฐพ์์ ์กฐ๊ธ์ฉ ๊ณ ์ณ์ ์ฌ์ฉํ๊ธฐ
๋ถํธ์คํธ๋ฉ ์์ ํ ํ๋ฆฟ (์คํ๋ฅดํ์ฝ๋ฉํด๋ฝ์์ ์ ๊ณต)
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
crossorigin="anonymous"></script>
<title>์คํ๋ฅดํ์ฝ๋ฉํด๋ฝ | ๋ถํธ์คํธ๋ฉ ์ฐ์ตํ๊ธฐ</title>
</head>
<body>
<h1>์ด๊ฑธ๋ก ์์ํด๋ณด์ฃ !</h1>
</body>
</html>
ํด๋ผ์ด์ธํธ
์ ์๋ฒ
๊ฐ ์์ฒญ๊ณผ ์ ๋ฌ์ ํด์ค(์ฐธ๊ณ : Java์ Javascript๋ ์๋ฌด ๊ด๋ จ ์์)
<head>
์์ <script>
๋ฅผ ๋ง๋ค์ด ์์ฑ!function hey() {
}
ํฌ๋กฌ ๊ฐ๋ฐ์๋๊ตฌ
-> console
์์ ํ์ธ ๊ฐ๋ฅfor (1. ์์์กฐ๊ฑด; 2. ๋ฐ๋ณต์กฐ๊ฑด; 3. ๋ํ๊ธฐ) {
4. ๋งค๋ฒ์คํ
}
๋ถํธ์คํธ๋ฉ ๋๋ ํ ํ๋ฆฟ์ ํ์ฉํด์ ํฌ๋ช ๋ก์ ๋ฉ์ธ ํ์ด์ง๋ฅผ ์์ฑํด์ฃผ์ธ์. (๋ด๊ฐ ์ข์ํ๋ ์ํฐ์คํธ๋ก ํด๋ณด์ธ์!)
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM"
crossorigin="anonymous"></script>
<title>ํฌ๋ช
๋ก ๋ง๋ค๊ธฐ</title>
<link href="https://fonts.googleapis.com/css2?family=Gowun+Dodum&display=swap" rel="stylesheet">
<style>
* {
font-family: 'Gowun Dodum', sans-serif;
}
.mytitle {
height: 250px;
width: 100%;
/* ๋ฐฐ๊ฒฝ ์ด๋ก๊ฒ ํ๊ธฐ :: linear-gradient(0deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)) */
background-image: linear-gradient(0deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url("https://pbs.twimg.com/media/DdzGr4dVwAMbc4M?format=jpg&name=4096x4096");
background-position: center;
background-size: cover;
color: white;
/*display: flex ๋ด์ฉ๋ฌผ์ ๊ฐ์ด๋ฐ๋ก! 4์ค์ด ์ธํธ*/
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.mypost {
max-width : 500px;
width: 95%;
margin: 20px auto 0px auto;
box-shadow: 0px 0px 3px 0px grey;
padding: 20px;
}
.mybtn {
margin-top: 10px;
}
.mycards {
max-width : 500px;
width: 95%;
margin: 20px auto 0px auto;
}
.mycards > .card {
margin-top: 10px;
}
</style>
</head>
<body>
<div class="mytitle">
<h1>ํ์ฐ ํฌ๋ช
๋ก</h1>
</div>
<div class="mypost">
<div class="form-floating mb-3">
<input type="email" class="form-control" id="floatingInput" placeholder="name@example.com">
<label for="floatingInput">๋๋ค์</label>
</div>
<div class="form-floating">
<textarea class="form-control" placeholder="Leave a comment here" id="floatingTextarea" style="height: 100px"></textarea>
<label for="floatingTextarea">์์ ๋๊ธ</label>
</div>
<div class="mybtn">
<button type="button" class="btn btn-dark">์์ ๋จ๊ธฐ๊ธฐ</button>
</div>
</div>
<div class="mycards">
<div class="card">
<div class="card-body">
<blockquote class="blockquote mb-0">
<p>์๋ก์ด ์จ๋ฒ ๋๋ฌด ์ข์์!</p>
<footer class="blockquote-footer"> ๋ฐ๊ตฌ</footer>
</blockquote>
</div>
</div>
<div class="card">
<div class="card-body">
<blockquote class="blockquote mb-0">
<p>์๋ก์ด ์จ๋ฒ ๋๋ฌด ์ข์์!</p>
<footer class="blockquote-footer"> ๋ฐ๊ตฌ</footer>
</blockquote>
</div>
</div>
<div class="card">
<div class="card-body">
<blockquote class="blockquote mb-0">
<p>์๋ก์ด ์จ๋ฒ ๋๋ฌด ์ข์์!</p>
<footer class="blockquote-footer"> ๋ฐ๊ตฌ</footer>
</blockquote>
</div>
</div>
</div>
</body>
</html>
1. ๋๋ ์ ์ ์์, ๋ด๊ฐ ์ด ์์
์ ์ฐธ์ฌํ๊ฒ ๋ ์ด์ .
ํฌํธํด๋ฆฌ์ค๋ฅผ ๋ง๋ค์ด๋ณด๊ณ ์ถ์๋ฐ ํผ์์๋ ๋๋ฌด ๋ง๋งํ ๊ฒ ๊ฐ์ฅ ์ปธ๋ค. ์จ๋ผ์ธ์์๋ ๋ถ๊ตฌํ๊ณ ์๊ฐ์์ด ๋๊น์ง ์์ฃผํ ์ ์๋๋ก ์ ๊ฒฝ์ด ๊ฒ ๋ง์ ๊ฐ์ ๊ฐ์ ํฐ ๋ง์ ๋จน๊ณ ๊ฒฐ์ ํ๊ฒ ๋์๋ค.
2. 1์ฃผ์ฐจ๋ฅผ ๋ค์ด๋ณด๋๊น~
์ด๋ฐ ๊ฐ์๋ ์ฒ์์ด๋ผ ์ด๋จ์ง ๋ชฐ๋๋ค. 1์ฃผ์ฐจ์ ์ธ๋ถํญ๋ชฉ๋ณ๋ก ์งง๊ฒ๋ 3๋ถ, ๊ธธ๊ฒ๋ 10๋ถ ๊ฐ๋์ ๊ฐ์๊ฐ ์์๋๋ฐ ํ์๊ฐ ํต์ผ๋ก ์ด์ด์ ธ ์๋ ๊ฒ ์๋๋ผ ํญ๋ชฉ๋ณ๋ก ์๋ ๊ฒ ์ข์๋ค. ์๊ฐ์ด ์ฌ์ ์์ ๋๋ ๋ด๊ฐ ์ด๋๊น์ง ๋ค์๋์ง ์ฒดํฌ๊ฐ ๊ฐ๋ฅํ๊ณ , ๋ณด๋ค ๊ฐ๋ณ๊ฒ ๋๊ปด์ ธ์ ๋ถ๋ด๊ฐ์ด ๋ํ๋ค. ์์
๋ด์ฉ๋ ์กฐ๊ธ ๋น ๋ฅธ ๊ฐ์ด ์์์ง๋ง ์์ฐผ๊ณ , ์ค๊ฐ์ค๊ฐ ๊ฟํ๋ชจ์๋ ์ค์ฉ์ ์ด์๋ค. ์ค๋ฌด ์์ฃผ์ธ ๊ฒ ๊ฐ์ ๋ ์ ์ฉ์ ์ธ ๋๋์ด ๋ค์๋ค. ์ฝ๋๊ฐ ๊ธธ๊ฑฐ๋ ๊ตณ์ด ํ๋ํ๋ ์ณ๋ ๋์ง ์๋ ๊ฒ๋ค ๋๋ ์น์ฌ์ดํธ ๋ฐ๋ก๊ฐ๊ธฐ ๋ฑ ์ฝ๋์ค๋ํซ์ ์ด์ฉํ๋๊น ํจ์ฌ ๊ฐํธํ๋ค!
(๋ณ์ : โญโญโญโญโญ)
3. ์ด๋ ค์ ๋ ๋ถ๋ถ..
์์
์ง๋ ์ค์ '๋ด ์์ด ์ต๊ณ ์ ์ํ๋ค' ๋ฅผ ๋ง๋๋ ์ค ๋ถํธ์คํธ๋ฉ์ ํ์ฉํ๋ ์๊ฐ์ ํผ์์ ํ ์๊ฐ์ ์ฃผ์
จ๋ค. ๋ง์ ํผ์์ ํ๋ ค๋๊น ๋๊ฒ ๋ง๋งํ๋ค. 20๋ถ์ ์ฃผ์
จ์ง๋ง ๊ทธ ์๊ฐ์ ์ด๊ณผํด์ ํ์ง ๋ชปํ๋ค.
1) ๋ด๊ฐ ์ํ๋ ํญ๋ชฉ์ ๋ถํธ์คํธ๋ฉ์์ ์ฐพ๋ ๊ฒ,
2) ์ํ๋ ๋ถ๋ถ๋ง ์ถ์ถํ๋ ๊ฒ(๋ณต์ฌํ๋ ๊ฒ),
3) ๋ด๊ฐ ์ํ๋ ์ฉ๋์ ๋ง๊ฒ ๋ฐ๊ฟ ์ ๋ ๊ฒ.
4) div์ ๊ฐ๋
.
์ด๋ ๊ฒ 4๊ฐ์ง๊ฐ ์ด๋ ค์ ๋ ๊ฒ ๊ฐ๋ค.
div์ ๋ํด ์ ๋๋ก ์๊ณ ์๋ค๊ณ ์๊ฐํ๋๋ฐ ์๋์๋ค. ๊ฐ์๋ฅผ ๋ค์ผ๋ฉด์, ์ ์๋์ ์ฝ๋๋ฅผ ๋ฐ๋ผ ์ณ๋ณด๋ฉด์ div์ ๋ํ ๊ฐ์ด ์กฐ๊ธ์ฉ ์๊ฒผ๋ค. ์์ง ์ ๋๋ก ์ค๋ช
ํ ์ ๋๋ ์๋ ๊ฒ ๊ฐ๋ค.
๋ถํธ์คํธ๋ฉ์ ํ์ฉํ๋ ๊ฑด ๊ณผ์ ๋ฅผ ํ ๋์๋ ์ด๋ ค์์ด ์์๋ค. ๊ทธ๋์ ๊ฐ์์๋ฃ์ ์๋ ํํธ๋ฅผ ์ต๋ํ ๋ค ํ์ฉํ๋ค.
4. ๊ทธ๋ผ์๋ ๊ธฐ์ต์ ๋จ์๋ ๋ถ๋ถ!
.myclass > button
์ด๋ ๊ฒ ์ธ ์ ์๋ค๋ ๊ฒ์ด์๋ค! ์ ์ ํ๊ณ ์๋กญ๊ฒ ๋ค๊ฐ์๋ค. key
-value
์ ๊ฐ๋
์ด ์ฌ๋ฐ์๋ค. ๋์
๋๋ฆฌ๋ฅผ ๋ฆฌ์คํธ์์ ๋ง์ด ํ์ฉํ๊ณ ๋ฆฌ์คํธ๋ for๋ฌธ์์ ๋ง์ด ํ์ฉํ๊ณ . ์ด๋ฐ ๊ฒ๋ค์ด ์ฐ๊ฒฐ๋๋ ๊ฒ ์ฌ๋ฏธ์๋ค.๋ถํธ์คํธ๋ฉ
์ ์์ ์๊ฐ ์๋ค! ์์ฒญ ๋ง์ css ๋ชจ์๋ค์ด ์๋ค. ์ฒ์ ๋ณด๋ ๊ฑฐ๋ผ ๋ฏ์ค์ด๋ณด์๋๋ฐ ๊ณง ์ต์ํด์ง๊ฒ ์ง..?5. ๋ง์ง๋ง ์ ๋ฆฌํ๋ฉฐ, ๋ฆฌ๋ง์ธ๋!
- ์ธ์ธ ํ์ ์๋ค. ๋ ๋๋ ์ฌ๋๋ค์ด ์ด์ ์ ๋ง๋ค์๋ ๊ฒ๋ค์ ์ฉ๋์ ๋ง๊ฒ ํ์ฉํ์!
- ์ฝ๋ ์ ๋ ฌ์ด ์ค์ํ๋ค!
- div๋ ํ๋์ ๋ธ๋ญ! ํ์ธํ ๋ background ์ฃผ๊ธฐ.