π»Coding/π CSS
CSS _컬λ¬_color
μμμ
2021. 11. 23. 10:53
728x90
λ°μν
CSS _컬λ¬_color
colorλ μμ μ§μ νλ μμ±μΌλ‘ 3κ°μ§ λ°©λ²μΌλ‘ μμ±κ°μ μ€ μ μμ΅λλ€.
β»μμμ μ΄λ¦μ΄λ κ°μ μΈμΈ νμμμ΄ κ·Έλ νμν 컬λ¬λ κ²μμ ν΅νκ±°λ
ν¬ν μ΅μμ 컬λ¬λͺ
μ 볡μ¬ν΄μ λΆμ¬λ£μΌμλ©΄ λ©λλ€!
↓↓↓
[ CSS - font λ¬Έλ² ]
<style>
μ νμ { color : μμκ°; }
</style>
βΆ colorμ μμ±κ°μ μμ±νλ 3κ°μ§ λ°©λ²!
1) μμλͺ
: μμμ λΆλ₯΄λ κ³ μ λͺ
μΌλ‘ μμ±
2) #000000 : μμμ 16μ§μλ‘ μμ±
3) rgb (0, 0, 0) : μμμ rgbκ°μΌλ‘ νκΈ°
β» ν¬λͺ
λλ₯Ό μ‘°μ νκ³ μΆμ λλ color : rgba (0, 0, 0, ν¬λͺ
λ)
βΆ font-weight μ€μ μμ
[ html - css μμ± μ½λ ]
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>color</title>
<!-- css μ»¬λ¬ μ μ© λΆλΆ -->
<style>
p:first-child {
color: red;
}
p:nth-child(2) {
color: #ca00c0;
}
p:nth-child(3) {
color: rgb(20, 240, 30);
}
p:nth-child(4) {
color: rgb(240, 137, 20, 0.5);
}
</style>
</head>
<body>
<h2>color : μμ±κ°</h2>
<div>
<p>μμλͺ
μΌλ‘ μ»¬λ¬ λ°κΎΈκΈ°</p>
<p>16μ§μλ‘ μ»¬λ¬ λ°κΎΈκΈ°</p>
<p>rgbκ°μΌλ‘ μ»¬λ¬ λ°κΎΈκΈ°</p>
<p>ν¬λͺ
λ μ‘°μ νκΈ°</p>
</div>
</body>
</html>
[ μ€ν νλ©΄μ λ³ν ]
↓ css style μ μ© μ νλ©΄
↓ css style μ μ© νλ©΄
728x90
λ°μν