Cascading Style Sheets
- INLINE STYLES
html ์ฝ๋ ์์ฑ์ค์ ์ง์ด ๋ฃ์ ์ ์์ง๋ง ํํ ์ฌ์ฉ x
<h1 style="color: aqua;">Hello</h1>
<button style="color: blueviolet;">push</button>
- THE <STYLE> ELEMENT
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Css intro</title>
<style>
h2 {color: palevioletred}
</style>
</head>
<body>
<h2>Hello</h2>
<h2>speed</h2>
</body>
head์์ style์ ์ด์ฉํด์ body์ ์๋ h2 ์์๋ค์ ๋ํ ์ ๋ณด๋ฅผ ํ๋ฒ์ ์ ์ฉ ์ํฌ ์ ์๋ค.
- EXTERNAL STYLESHEET
์๋ก์ด cssํ์ผ์ ๋ง๋ค์ด์ <link>๋ฅผ ์ด์ฉํด ์ฐ๊ฒฐ์ํด
link๋ head ์์์ ์ฌ์ฉ
CSS Rules
color and background-color
h2 {color: indigo;}
p {background-color: aquamarine;}
semicolon ์ฃผ์ !
Color System - rgb, etc.
RGB
1.Red, Green, Blue channels
2.Each channel ranges 0-255
ex) rgb(173,20,219)
color: rgb(89,151,0)
Hex
1.Red, Green, Blue channels
2.Each channel ranges 0-255 (00~ff)
BUT represented with hexadecimal (16์ง๋ฒ)
# ff ff 00
(red)(green)(blue)
CSS Text Properties
text-align - ์ ๋ ฌ
ex)text-align : center;
font-weight - ๊ตต๊ธฐ
text-decoration - ์๋ซ์ค, ์์ค, ์ทจ์์ ๋ฑ๋ฑ.
text-decoration: #f1592f underline;
line-height - ์ค ๊ฐ๊ฒฉ
letter-spacing - ๊ธ์ ์ฌ์ด์ ๊ฐ๊ฒฉ
font-size - ๊ธ์ ํฌ๊ธฐ
๊ฐ๊ฐ์ ๋จ์๋ ์ข
๋ฅ๊ฐ ์ ๋ง ๋ง์
font-family - ํฐํธ
,(์ฝค๋ง)๋ฅผ ์ด์ฉํด์ ๋ฐฑ์
ํฐํธ๋ ์ฌ์ฉํ ์ ์์
+text-transform:uppercase