CSS ๊ธฐ์ด
CSS ๊ธฐ์ด¶
1. CSS๋?¶
CSS(Cascading Style Sheets)๋ HTML ์์์ ์คํ์ผ์ ์ ์ํ๋ ์ธ์ด์ ๋๋ค.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ CSS์ ์ญํ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ โข ์์, ํฐํธ, ํฌ๊ธฐ โ
โ โข ๋ ์ด์์, ์์น โ
โ โข ์ ๋๋ฉ์ด์
, ์ ํ ํจ๊ณผ โ
โ โข ๋ฐ์ํ ๋์์ธ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
2. CSS ์ ์ฉ ๋ฐฉ๋ฒ¶
์ธ๋ผ์ธ ์คํ์ผ (๊ถ์ฅํ์ง ์์)¶
<p style="color: red; font-size: 16px;">๋นจ๊ฐ ํ
์คํธ</p>
๋ด๋ถ ์คํ์ผ์ํธ¶
<!DOCTYPE html>
<html>
<head>
<style>
p {
color: blue;
font-size: 18px;
}
</style>
</head>
<body>
<p>ํ๋ ํ
์คํธ</p>
</body>
</html>
์ธ๋ถ ์คํ์ผ์ํธ (๊ถ์ฅ)¶
<!-- index.html -->
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="style.css">
</head>
<body>
<p>์คํ์ผ์ด ์ ์ฉ๋ ํ
์คํธ</p>
</body>
</html>
/* style.css */
p {
color: green;
font-size: 20px;
}
3. CSS ๋ฌธ๋ฒ¶
๊ธฐ๋ณธ ๊ตฌ์กฐ¶
์ ํ์ {
์์ฑ: ๊ฐ;
์์ฑ: ๊ฐ;
}
/* ์์ */
h1 {
color: blue;
font-size: 24px;
text-align: center;
}
์ฃผ์¶
/* ํ ์ค ์ฃผ์ */
/*
์ฌ๋ฌ ์ค
์ฃผ์
*/
4. ์ ํ์ (Selectors)¶
๊ธฐ๋ณธ ์ ํ์¶
/* ์ ์ฒด ์ ํ์ */
* {
margin: 0;
padding: 0;
}
/* ํ๊ทธ ์ ํ์ */
p {
color: black;
}
/* ํด๋์ค ์ ํ์ */
.highlight {
background-color: yellow;
}
/* ID ์ ํ์ */
#header {
background-color: navy;
}
<p>์ผ๋ฐ ๋ฌธ๋จ</p>
<p class="highlight">๊ฐ์กฐ๋ ๋ฌธ๋จ</p>
<div id="header">ํค๋</div>
๊ทธ๋ฃน ์ ํ์¶
/* ์ฌ๋ฌ ์์์ ๊ฐ์ ์คํ์ผ */
h1, h2, h3 {
font-family: Arial, sans-serif;
}
.btn, .link, .card {
cursor: pointer;
}
๊ฒฐํฉ ์ ํ์¶
/* ์์ ์ ํ์ (๋ชจ๋ ํ์) */
article p {
line-height: 1.6;
}
/* ์์ ์ ํ์ (์ง์ ์์๋ง) */
ul > li {
list-style: none;
}
/* ์ธ์ ํ์ ์ ํ์ (๋ฐ๋ก ๋ค์) */
h1 + p {
font-size: 1.2em;
}
/* ์ผ๋ฐ ํ์ ์ ํ์ (๋ค์ ์๋ ๋ชจ๋ ) */
h1 ~ p {
color: gray;
}
<article>
<p>์ง์ ์์</p>
<div>
<p>์์ ์์</p> <!-- article p๋ ๋ ๋ค ์ ํ -->
</div>
</article>
<h1>์ ๋ชฉ</h1>
<p>์ฒซ ๋ฒ์งธ ๋ฌธ๋จ</p> <!-- h1 + p ์ ํ -->
<p>๋ ๋ฒ์งธ ๋ฌธ๋จ</p> <!-- h1 ~ p ์ ํ -->
์์ฑ ์ ํ์¶
/* ์์ฑ์ด ์๋ ์์ */
[disabled] {
opacity: 0.5;
}
/* ์์ฑ๊ฐ์ด ์ผ์น */
[type="text"] {
border: 1px solid gray;
}
/* ์์ฑ๊ฐ์ผ๋ก ์์ */
[href^="https"] {
color: green;
}
/* ์์ฑ๊ฐ์ผ๋ก ๋๋จ */
[href$=".pdf"] {
color: red;
}
/* ์์ฑ๊ฐ ํฌํจ */
[class*="btn"] {
cursor: pointer;
}
๊ฐ์ ํด๋์ค ์ ํ์¶
/* ๋งํฌ ์ํ */
a:link { color: blue; } /* ๋ฐฉ๋ฌธ ์ */
a:visited { color: purple; } /* ๋ฐฉ๋ฌธ ํ */
a:hover { color: red; } /* ๋ง์ฐ์ค ์ฌ๋ฆผ */
a:active { color: orange; } /* ํด๋ฆญ ์ค */
/* ํฌ์ปค์ค */
input:focus {
border-color: blue;
outline: none;
}
/* ์ฒซ ๋ฒ์งธ/๋ง์ง๋ง */
li:first-child { font-weight: bold; }
li:last-child { border-bottom: none; }
/* n๋ฒ์งธ */
tr:nth-child(odd) { background: #f0f0f0; } /* ํ์ */
tr:nth-child(even) { background: #ffffff; } /* ์ง์ */
tr:nth-child(3) { color: red; } /* 3๋ฒ์งธ */
tr:nth-child(3n) { font-weight: bold; } /* 3์ ๋ฐฐ์ */
/* not (๋ถ์ ) */
p:not(.special) {
color: gray;
}
/* ํผ ์ํ */
input:disabled { background: #ddd; }
input:checked + label { font-weight: bold; }
input:required { border-color: red; }
๊ฐ์ ์์ ์ ํ์¶
/* ์ฒซ ๊ธ์/์ฒซ ์ค */
p::first-letter {
font-size: 2em;
font-weight: bold;
}
p::first-line {
color: blue;
}
/* ์/๋ค์ ์ฝํ
์ธ ์ถ๊ฐ */
.quote::before {
content: '"';
}
.quote::after {
content: '"';
}
/* ์์: ํ์ ํ์ */
.required::after {
content: ' *';
color: red;
}
/* ์ ํ ์์ญ */
::selection {
background: yellow;
color: black;
}
5. ์์¶
์์ ํํ ๋ฐฉ๋ฒ¶
/* ์์ ์ด๋ฆ */
color: red;
color: blue;
color: transparent;
/* HEX (16์ง์) */
color: #ff0000; /* ๋นจ๊ฐ */
color: #f00; /* ๋นจ๊ฐ (์ถ์ฝ) */
color: #336699;
/* RGB */
color: rgb(255, 0, 0); /* ๋นจ๊ฐ */
color: rgb(51, 102, 153);
/* RGBA (ํฌ๋ช
๋) */
color: rgba(255, 0, 0, 0.5); /* 50% ํฌ๋ช
๋นจ๊ฐ */
/* HSL (์์, ์ฑ๋, ๋ช
๋) */
color: hsl(0, 100%, 50%); /* ๋นจ๊ฐ */
color: hsla(0, 100%, 50%, 0.5);
๋ฐฐ๊ฒฝ์¶
.box {
background-color: #f0f0f0;
background-color: rgba(0, 0, 0, 0.1);
}
6. ํ ์คํธ ์คํ์ผ¶
ํฐํธ¶
.text {
/* ํฐํธ ํจ๋ฐ๋ฆฌ */
font-family: 'Noto Sans KR', Arial, sans-serif;
/* ํฐํธ ํฌ๊ธฐ */
font-size: 16px;
font-size: 1rem;
font-size: 1.5em;
/* ํฐํธ ๊ตต๊ธฐ */
font-weight: normal; /* 400 */
font-weight: bold; /* 700 */
font-weight: 300; /* light */
/* ํฐํธ ์คํ์ผ */
font-style: normal;
font-style: italic;
/* ๋จ์ถ ์์ฑ */
font: italic bold 16px/1.5 Arial, sans-serif;
}
ํ ์คํธ¶
.text {
/* ์์ */
color: #333;
/* ์ ๋ ฌ */
text-align: left;
text-align: center;
text-align: right;
text-align: justify;
/* ์ฅ์ */
text-decoration: none;
text-decoration: underline;
text-decoration: line-through;
/* ๋ณํ */
text-transform: uppercase;
text-transform: lowercase;
text-transform: capitalize;
/* ๋ค์ฌ์ฐ๊ธฐ */
text-indent: 20px;
/* ์ค ๋์ด */
line-height: 1.6;
/* ๊ธ์ ๊ฐ๊ฒฉ */
letter-spacing: 1px;
/* ๋จ์ด ๊ฐ๊ฒฉ */
word-spacing: 2px;
/* ๊ทธ๋ฆผ์ */
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}
7. ๋ฐ์ค ๋ชจ๋ธ¶
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ margin โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ border โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ padding โ โ โ
โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ
โ โ โ โ โ โ โ โ
โ โ โ โ content โ โ โ โ
โ โ โ โ โ โ โ โ
โ โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ โ
โ โ โ โ โ โ
โ โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ โ
โ โ โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
content (๋ด์ฉ)¶
.box {
width: 200px;
height: 100px;
/* ์ต์/์ต๋ ํฌ๊ธฐ */
min-width: 100px;
max-width: 500px;
min-height: 50px;
max-height: 300px;
}
padding (์์ชฝ ์ฌ๋ฐฑ)¶
.box {
/* ๊ฐ๋ณ ์ง์ */
padding-top: 10px;
padding-right: 20px;
padding-bottom: 10px;
padding-left: 20px;
/* ๋จ์ถ ์์ฑ */
padding: 10px; /* ๋ชจ๋ 10px */
padding: 10px 20px; /* ์ํ 10px, ์ข์ฐ 20px */
padding: 10px 20px 15px; /* ์ 10px, ์ข์ฐ 20px, ํ 15px */
padding: 10px 20px 15px 25px; /* ์ ์ฐ ํ ์ข (์๊ณ๋ฐฉํฅ) */
}
border (ํ ๋๋ฆฌ)¶
.box {
/* ๊ฐ๋ณ ์ง์ */
border-width: 1px;
border-style: solid;
border-color: black;
/* ๋จ์ถ ์์ฑ */
border: 1px solid black;
/* ๊ฐ ๋ณ ๊ฐ๋ณ */
border-top: 2px dashed red;
border-right: none;
border-bottom: 1px solid gray;
border-left: 3px double blue;
/* ํ
๋๋ฆฌ ์คํ์ผ */
border-style: solid; /* ์ค์ */
border-style: dashed; /* ํ์ */
border-style: dotted; /* ์ ์ */
border-style: double; /* ์ด์ค์ */
border-style: none; /* ์์ */
}
margin (๋ฐ๊นฅ ์ฌ๋ฐฑ)¶
.box {
/* padding๊ณผ ๊ฐ์ ๋ฌธ๋ฒ */
margin: 10px;
margin: 10px 20px;
margin: 10px 20px 15px 25px;
/* ๊ฐ์ด๋ฐ ์ ๋ ฌ */
margin: 0 auto;
/* ์์ ๊ฐ ๊ฐ๋ฅ */
margin-top: -10px;
}
box-sizing¶
/* ๊ธฐ๋ณธ๊ฐ: content ํฌ๊ธฐ๋ง ํฌํจ */
.box-content {
box-sizing: content-box;
width: 200px;
padding: 20px;
border: 10px solid black;
/* ์ค์ ๋๋น: 200 + 40 + 20 = 260px */
}
/* border๊น์ง ํฌํจ (๊ถ์ฅ) */
.box-border {
box-sizing: border-box;
width: 200px;
padding: 20px;
border: 10px solid black;
/* ์ค์ ๋๋น: 200px (content๊ฐ ์ค์ด๋ฆ) */
}
/* ์ ์ญ ์ค์ (๊ถ์ฅ) */
*, *::before, *::after {
box-sizing: border-box;
}
8. ๋ฐฐ๊ฒฝ¶
.box {
/* ๋ฐฐ๊ฒฝ์ */
background-color: #f0f0f0;
/* ๋ฐฐ๊ฒฝ ์ด๋ฏธ์ง */
background-image: url('image.jpg');
/* ๋ฐ๋ณต */
background-repeat: repeat; /* ๊ธฐ๋ณธ๊ฐ */
background-repeat: no-repeat;
background-repeat: repeat-x;
background-repeat: repeat-y;
/* ์์น */
background-position: center;
background-position: top right;
background-position: 50% 50%;
background-position: 10px 20px;
/* ํฌ๊ธฐ */
background-size: auto; /* ์๋ณธ ํฌ๊ธฐ */
background-size: cover; /* ์์ญ์ ๋ฎ์ */
background-size: contain; /* ์ด๋ฏธ์ง ์ ์ฒด ํ์ */
background-size: 100px 200px;
/* ๊ณ ์ */
background-attachment: scroll; /* ์คํฌ๋กค */
background-attachment: fixed; /* ๊ณ ์ */
/* ๋จ์ถ ์์ฑ */
background: #f0f0f0 url('image.jpg') no-repeat center/cover;
}
๊ทธ๋ผ๋์ธํธ¶
.gradient {
/* ์ ํ ๊ทธ๋ผ๋์ธํธ */
background: linear-gradient(to right, red, blue);
background: linear-gradient(45deg, red, yellow, green);
background: linear-gradient(to bottom, #fff 0%, #000 100%);
/* ๋ฐฉ์ฌํ ๊ทธ๋ผ๋์ธํธ */
background: radial-gradient(circle, red, blue);
background: radial-gradient(ellipse at center, #fff, #000);
}
9. ํ ๋๋ฆฌ์ ๊ทธ๋ฆผ์¶
border-radius (๋ฅ๊ทผ ๋ชจ์๋ฆฌ)¶
.box {
border-radius: 10px; /* ๋ชจ๋ ๋ชจ์๋ฆฌ */
border-radius: 10px 20px; /* ๋๊ฐ์ */
border-radius: 10px 20px 30px 40px; /* ๊ฐ ๋ชจ์๋ฆฌ */
border-radius: 50%; /* ์ */
}
box-shadow (๊ทธ๋ฆผ์)¶
.box {
/* x y blur spread color */
box-shadow: 5px 5px 10px rgba(0, 0, 0, 0.3);
/* ์์ชฝ ๊ทธ๋ฆผ์ */
box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
/* ๋ค์ค ๊ทธ๋ฆผ์ */
box-shadow:
0 2px 4px rgba(0, 0, 0, 0.1),
0 4px 8px rgba(0, 0, 0, 0.1);
}
outline (์ธ๊ณฝ์ )¶
.box {
outline: 2px solid blue;
outline-offset: 5px; /* border์์ ๊ฐ๊ฒฉ */
}
/* ํฌ์ปค์ค ์ */
input:focus {
outline: 2px solid #4CAF50;
}
10. ๋จ์¶
์ ๋ ๋จ์¶
.box {
width: 200px; /* ํฝ์
(๊ณ ์ ) */
font-size: 12pt; /* ํฌ์ธํธ (์ธ์์ฉ) */
}
์๋ ๋จ์¶
.box {
/* em: ๋ถ๋ชจ ์์์ font-size ๊ธฐ์ค */
font-size: 1.5em;
padding: 2em;
/* rem: ๋ฃจํธ(html) ์์์ font-size ๊ธฐ์ค (๊ถ์ฅ) */
font-size: 1rem; /* ๋ณดํต 16px */
margin: 1.5rem;
/* %: ๋ถ๋ชจ ์์ ๊ธฐ์ค */
width: 50%;
font-size: 120%;
/* vw/vh: ๋ทฐํฌํธ ๊ธฐ์ค */
width: 100vw; /* ๋ทฐํฌํธ ๋๋น์ 100% */
height: 100vh; /* ๋ทฐํฌํธ ๋์ด์ 100% */
font-size: 5vw; /* ๋ทฐํฌํธ ๋๋น์ 5% */
}
๋จ์ ์ ํ ๊ฐ์ด๋¶
| ์ฉ๋ | ๊ถ์ฅ ๋จ์ |
|---|---|
| ํฐํธ ํฌ๊ธฐ | rem |
| ํจ๋ฉ/๋ง์ง | rem ๋๋ em |
| ๋๋น | %, vw, px |
| ๋์ด | vh, px, auto |
| ํ ๋๋ฆฌ | px |
11. ํ์ ์์ฑ¶
display¶
/* ๋ธ๋ก (ํ ์ค ์ฐจ์ง) */
.block {
display: block;
}
/* ์ธ๋ผ์ธ (๋ด์ฉ๋งํผ) */
.inline {
display: inline;
}
/* ์ธ๋ผ์ธ-๋ธ๋ก (์ธ๋ผ์ธ์ฒ๋ผ ๋ฐฐ์น, ๋ธ๋ก์ฒ๋ผ ํฌ๊ธฐ ์ง์ ) */
.inline-block {
display: inline-block;
width: 100px;
height: 50px;
}
/* ์จ๊น (๊ณต๊ฐ ์ฐจ์ง ์ ํจ) */
.hidden {
display: none;
}
/* Flexbox (๋ค์ ์ฅ์์ ์์ธํ) */
.flex {
display: flex;
}
/* Grid (๋ค์ ์ฅ์์ ์์ธํ) */
.grid {
display: grid;
}
visibility¶
/* ์จ๊น (๊ณต๊ฐ ์ ์ง) */
.invisible {
visibility: hidden;
}
/* ํ์ */
.visible {
visibility: visible;
}
opacity¶
.transparent {
opacity: 0; /* ์์ ํฌ๋ช
*/
opacity: 0.5; /* 50% ํฌ๋ช
*/
opacity: 1; /* ๋ถํฌ๋ช
*/
}
12. ์ฐ์ ์์ (Specificity)¶
์ฐ์ ์์ ๊ณ์ฐ¶
!important > ์ธ๋ผ์ธ ์คํ์ผ > ID > Class/์์ฑ/๊ฐ์ํด๋์ค > ํ๊ทธ/๊ฐ์์์
์ ์ ๊ณ์ฐ:
- ์ธ๋ผ์ธ ์คํ์ผ: 1000
- ID ์ ํ์: 100
- Class, ์์ฑ, ๊ฐ์ํด๋์ค: 10
- ํ๊ทธ, ๊ฐ์์์: 1
์์¶
/* ์ ์: 1 (ํ๊ทธ) */
p { color: black; }
/* ์ ์: 10 (ํด๋์ค) */
.text { color: blue; }
/* ์ ์: 100 (ID) */
#main { color: red; }
/* ์ ์: 11 (ํ๊ทธ + ํด๋์ค) */
p.text { color: green; }
/* ์ ์: 110 (ID + ํด๋์ค) */
#main.text { color: purple; }
/* ๊ฐ์ (๋น์ถ์ฒ) */
p { color: orange !important; }
๊ฐ์ ์ ์์ผ ๋¶
๋์ค์ ์ ์ธ๋ ์คํ์ผ์ด ์ ์ฉ๋ฉ๋๋ค.
.text { color: red; }
.text { color: blue; } /* ์ด๊ฒ์ด ์ ์ฉ๋จ */
13. ์์¶
์์๋๋ ์์ฑ¶
body {
/* ์์์๊ฒ ์์๋จ */
font-family: Arial;
font-size: 16px;
color: #333;
line-height: 1.6;
}
์์๋์ง ์๋ ์์ฑ¶
.parent {
/* ์์์๊ฒ ์์ ์ ๋จ */
width: 500px;
height: 300px;
border: 1px solid black;
background: gray;
margin: 20px;
padding: 10px;
}
์์ ์ ์ด¶
.child {
color: inherit; /* ๋ถ๋ชจ ๊ฐ ์์ */
border: initial; /* ๊ธฐ๋ณธ๊ฐ์ผ๋ก */
margin: unset; /* ์์๋๋ฉด inherit, ์๋๋ฉด initial */
}
14. CSS ๋ฆฌ์ ¶
๋ธ๋ผ์ฐ์ ๋ง๋ค ๊ธฐ๋ณธ ์คํ์ผ์ด ๋ฌ๋ผ์ ์ด๊ธฐํ๊ฐ ํ์ํฉ๋๋ค.
๊ฐ๋จํ ๋ฆฌ์ ¶
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI',
Roboto, 'Noto Sans KR', sans-serif;
line-height: 1.6;
}
ul, ol {
list-style: none;
}
a {
text-decoration: none;
color: inherit;
}
img {
max-width: 100%;
display: block;
}
button {
cursor: pointer;
border: none;
background: none;
}
15. ์์ ํ ์์ ¶
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CSS ๊ธฐ์ด ์์ </title>
<link rel="stylesheet" href="style.css">
</head>
<body>
<header class="header">
<h1 class="logo">My Website</h1>
<nav class="nav">
<a href="#" class="nav-link">ํ</a>
<a href="#" class="nav-link">์๊ฐ</a>
<a href="#" class="nav-link">์ฐ๋ฝ์ฒ</a>
</nav>
</header>
<main class="main">
<article class="card">
<h2 class="card-title">์ ๋ชฉ์
๋๋ค</h2>
<p class="card-text">
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
</p>
<button class="btn">์์ธํ ๋ณด๊ธฐ</button>
</article>
</main>
</body>
</html>
/* style.css */
/* ๋ฆฌ์
*/
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Noto Sans KR', sans-serif;
line-height: 1.6;
color: #333;
background-color: #f5f5f5;
}
/* ํค๋ */
.header {
background-color: #2c3e50;
color: white;
padding: 1rem 2rem;
display: flex;
justify-content: space-between;
align-items: center;
}
.logo {
font-size: 1.5rem;
font-weight: bold;
}
.nav-link {
color: white;
text-decoration: none;
margin-left: 1.5rem;
transition: opacity 0.3s;
}
.nav-link:hover {
opacity: 0.7;
}
/* ๋ฉ์ธ */
.main {
max-width: 800px;
margin: 2rem auto;
padding: 0 1rem;
}
/* ์นด๋ */
.card {
background: white;
border-radius: 8px;
padding: 2rem;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.card-title {
font-size: 1.5rem;
margin-bottom: 1rem;
color: #2c3e50;
}
.card-text {
color: #666;
margin-bottom: 1.5rem;
}
/* ๋ฒํผ */
.btn {
background-color: #3498db;
color: white;
padding: 0.75rem 1.5rem;
border: none;
border-radius: 4px;
font-size: 1rem;
cursor: pointer;
transition: background-color 0.3s;
}
.btn:hover {
background-color: #2980b9;
}
16. ์์ฝ¶
| ๊ฐ๋ | ์ค๋ช |
|---|---|
| ์ ํ์ | ์คํ์ผ์ ์ ์ฉํ ์์ ์ง์ |
| ๋ฐ์ค ๋ชจ๋ธ | content, padding, border, margin |
| ๋จ์ | px, rem, em, %, vw, vh |
| ์ฐ์ ์์ | !important > inline > ID > class > ํ๊ทธ |
| ์์ | ํ ์คํธ ๊ด๋ จ ์์ฑ์ ์์๋จ |
17. ์ฐ์ต ๋ฌธ์ ¶
์ฐ์ต 1: ๋ฒํผ ์คํ์ผ๋ง¶
๋ค์ํ ์์์ ๋ฒํผ์ ๋ง๋ค์ด๋ณด์ธ์. - primary, secondary, danger, success
์ฐ์ต 2: ์นด๋ ์ปดํฌ๋ํธ¶
์ด๋ฏธ์ง, ์ ๋ชฉ, ์ค๋ช , ๋ฒํผ์ด ์๋ ์นด๋๋ฅผ ๋ง๋์ธ์.
์ฐ์ต 3: ๋ค๋น๊ฒ์ด์ ๋ฐ¶
๊ฐ๋ก ๋ฉ๋ด๋ฅผ ๋ง๋ค๊ณ hover ํจ๊ณผ๋ฅผ ์ถ๊ฐํ์ธ์.
๋ค์ ๋จ๊ณ¶
04_CSS_Layout.md์์ Flexbox์ Grid๋ฅผ ๋ฐฐ์๋ด ์๋ค!