2025. 7. 28. 15:06ใStyle/CSS

๋ชฉ์ฐจ
1. color : ๊ธ์์
2. font-size : ๊ธ์ ํฌ๊ธฐ
3. font-family : ๊ธ๊ผด
4. fon-weight : ๊ธ์ ๊ตต๊ธฐ
5. line-height : ์ค ๋์ด
6. text-decoration : ํ ์คํธ ๊พธ๋ฏธ๊ธฐ
1. color : ๊ธ์์
๊ธ์์์ ์ง์ ํ๋ ์์ฑ์ด๋ค. text, font ๊ฐ์ ๊ฑฐ ์๋ถ์ด๊ณ ๋จ์ํ color๋ง ์ฌ์ฉํ๋ค.
์ฌ๋ฌ ์์ ๋จ์๋ก ์์ฑ๊ฐ์ ์ง์ ํ๋ค.
.red-text {
color: red;
}
.blue-text {
color: #0000ff;
}
.green-text {
color: rgb(0,255,0);
}

2. font-size : ๊ธ์ ํฌ๊ธฐ
๊ธ์ ํฌ๊ธฐ๋ฅผ ์ง์ ํ๋ ์์ฑ์ด๋ค.
์ง์ ๋ ํค์๋ ํน์ ํฌ๊ธฐ ๋จ์๋ก ์์ฑ๊ฐ์ ์ง์ ํ๋ค.
#large-text {
font-size: large;
}
#medium-text {
font-size: medium;
}
#small-text {
font-size: small;
}
#px-text {
font-size: 10px;
}
#em-text {
font-size: 2em;
}
#rem-text {
font-size: 2rem;
}

3. font-family : ๊ธ๊ผด
์ฌ์ฉํ๊ณ ์ถ์ ๊ธ๊ผด์ ๋ค์ด๋ฐ์์ ์ฌ์ฉํ ์๋ ์๊ณ , ๊ธฐ๋ณธ์ผ๋ก ์ฌ์ฉ๊ฐ๋ฅํ ๊ธ๊ผด๋ค ์ค ๊ณจ๋ผ์ ์ฌ์ฉํ ์๋ ์๋ค.
#font-courier {
font-family: 'Courier New', Courier, monospace;
}
#font-georgia {
font-family: Georgia, 'Times New Roman', Times, serif;
}

4. font-weight : ๊ธ์ ๊ตต๊ธฐ
์ง์ ๋ ํค์๋ ๋ฐ 100๋จ์ ์ซ์๋ก 100~900์ ์์ฑ๊ฐ์ผ๋ก ์ฌ์ฉํ๋ค.
#_bold {
font-weight: bold;
}
#_100 {
font-weight: 100;
}
#_500 {
font-weight: 500;
}
#_900 {
font-weight: 900;
}

5. line-height : ์ค ๋์ด
ํ ์คํธ ์ฌ์ด ๊ฐ๊ฒฉ์ ์กฐ์ ํ ๋ ์ฌ์ฉํ๋ค.
๋จ์๋ก ์ง์ ์ ๋ ฅํ ์๋ ์์ง๋ง
๋จ์ ์ซ์๋ง ์ ๋ ตํ ๊ฒฝ์ฐ, ํด๋น ์ซ์๋ฅผ font-size์ ๊ณฑํ๋ ์์ผ๋ก ๋ค์ด๊ฐ๋ค.
#_3px {
line-height: 3px;
}
#_1 {
line-height: 1;
}
#_2 {
line-height: 2;
}

6. text-decoration : ํ ์คํธ ๊พธ๋ฏธ๊ธฐ
ํ ์คํธ์ ๋ฐ์ค์ ๋ฃ๊ฑฐ๋ ์ทจ์์ ์ ๋ฃ๋ ๋ฑ์ ๊ฒฝ์ฐ์ ์ฌ์ฉํ๋ค.
none์ ๊ฒฝ์ฐ, ๊ธฐ๋ณธ์ ์ผ๋ก ๋ฐ์ค์ด ๋ค์ด๊ฐ๋ ํ๊ทธ (<a>)์์ ๋ฐ์ค์ ์์จ ๋ ๋ง์ด ์ฌ์ฉํ๋ค.
#_none {
text-decoration: none;
}
#_underline {
text-decoration: underline;
}
#_line-through {
text-decoration: line-through;
}

์ฐธ๊ณ
codeit ๊ฐ์
'Style > CSS' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
| CSS : display์ float (0) | 2025.07.28 |
|---|---|
| CSS : ๋ฐ์ค ๋ชจ๋ธ (Box Model) (1) | 2025.07.28 |
| CSS ๋จ์ ์ด์ ๋ฆฌ : ์์, ํฌ๊ธฐ, ์๊ฐ, ๊ฐ๋ (5) | 2025.07.28 |
| CSS : absolute position (0) | 2025.02.15 |
| CSS 1 : CSS ๊ธฐ๋ณธ ๊ฐ๋ (1) | 2025.01.23 |
GitHub