===============================================================style.css===============================================
/*<<<<<<<<<<<<<<< CSS Selector >>>>>>>>>>>>>>>>>>>*/
/*[๊ธฐ๋ณธ ์ ํ์ => '', '#', '.'. '[PropertyName]', '[PropertyName = Value]']*/
/*ํ๊ทธ*/
p{
ย ย background-color: yellow;
}
/*์์ด๋*/
#id1{
ย ย color:yellow;
ย ย background-color: black;
}
/*ํด๋์ค*/
p.class1{
ย ย color:red;
ย ย background-color: navy;
}
/*์์ฑ ์ฌ๋ถ*/
h1[text]{
ย ย color:purple;
}
/*์์ฑ ๊ฐ*/
h1[text = "come"]{
ย ย color: aqua;
ย ย background-color: brown;
}
/*[๋ฐ์ ์ ํ์ => ':']*/
/*๋ค์ํ ์ด๋ฒคํธ to tag*/
a:link{
ย ย color: green;
}
a:hover{
ย ย color: red;
ย ย background-color: yellow;
}
/*[๊ตฌ์กฐ ์ ํ์ => ':']*/
/*๋์ผ ํ๊ทธ์์ n( to formula)๋ฒ์งธ ์์ ์ ํ : nth-child(formula)*/
p{
ย ย background-color: white;
}
p:nth-child(1){
ย ย background-color: red;
}
p:nth-child(2){
ย ย background-color: orange;
}
p:nth-child(3){
ย ย background-color: yellow;
}
p:nth-child(4){
ย ย background-color: blue;
}
/*๋งจ ์ฒ์ ์์ ์ ํ, ๋งจ ๋ง์ง๋ง ์์ ์ ํ : first-child, last-child*/
th:first-child{
ย ย border-radius: 10px 0 0 0;
}
th:last-child{
ย ย border-radius: 0 30px 0 0;
}
tr:nth-child(2n + 1){
ย ย background-color: aqua;
}
tr:nth-child(2n){
ย ย background-color: red;
}
/*[์ํ ์ ํ์ => ':']*/
/*๋ค์ํ ์ด๋ฒคํธ to Form*/
input:disabled{
ย ย background-color: red;
}
input:enabled{
ย ย background-color: skyblue;
}
/*[๊ธฐํ ์ ํ์ => '::']*/
/*๋ค์ํ ํน์ํ ๊ฒฝ์ฐ to etc*/
div::selection{
ย ย color: green;
ย ย background-color: black;
}
/*[์กฐํฉ ์ ํ์ : ย ' ' ย | ย > ย | ย + ย | ย ~ ย | ย , ]*/
/*
A B = ์ ํ์ A์ ํฌํจ๋ ์ ํ์ B๋ฅผ ์ ํ(์ฌ๋ฌ๋ฒ ๊ฐ๋ฅ)
A > B = ์ ํ์ A์ ์์๋ง ํ๋๋ง ์ ํ
A + B = A์ ํ์ ๋ฐ๋ก ๋ค์์ ์ ํ์ B ํ๋๋ง ์ ํ(์ฌ๋ฌ๋ฒ ๊ฐ๋ฅ)
A ~ B = A์ ํ์ ๋ค์ ๋์ค๋ B์ ํ์ (๋ชจ๋) ์ ํ
A, B = ์ ํ์ A์ ์ ํ์ B๋ฅผ ์ ํ
*/
div h1{
ย ย color: red;
}
h1 + h2{
ย ย color: green;
}
h2 ~ p{
ย ย color: yellow;
ย ย background-color: black;
}
/*<<<<<<<<<<<<<<< CSS Style >>>>>>>>>>>>>>>>>>>*/
/*[๋ฐ์ค ์คํ์ผ]*/
==========================================================main.html========================================
<!DOCTYPE html>
<html lang="en">
<head>
ย ย <meta charset="UTF-8">
ย ย <link href="style.css" rel="stylesheet" type="text/css" />
ย ย <meta name="viewport" content="width=device-width, initial-scale=1.0">
ย ย <title>Document</title>
</head>
<body>
ย ย <p>Red</p>
ย ย <p>Orange</p>
ย ย <p>Yellow</p>
ย ย <p>Blue</p>
ย ย <p>Nothing</p>
ย ย <p>Nothing</p>
ย ย <table>
ย ย <tr>
ย ย ย ย <th>Head</th>
ย ย ย ย <th>Head</th>
ย ย ย ย <th>Head</th>
ย ย </tr>
ย ย <tr>
ย ย ย ย <th>Body</th>
ย ย ย ย <th>Body</th>
ย ย ย ย <th>Body</th>
ย ย </tr>
ย ย <tr>
ย ย ย ย <th>Body</th>
ย ย ย ย <th>Body</th>
ย ย ย ย <th>Body</th>
ย ย </tr>
ย ย <tr>
ย ย ย ย <th>Body</th>
ย ย ย ย <th>Body</th>
ย ย ย ย <th>Body</th>
ย ย </tr>
ย ย <tr>
ย ย ย ย <th>Foot</th>
ย ย ย ย <th>Foot</th>
ย ย ย ย <th>Foot</th>
ย ย </tr>
ย ย </table>
ย ย <br><br><br>
ย ย <strong>UnActive</strong>
ย ย <p><input disabled="disabled"/></p>
ย ย <strong>Active</strong>
ย ย <p><input enabled="enabled"/></p>
ย ย <div>
ย ย ๋ฐํํ๊ธฐ ์ฐพ์ ์์ํ๋ฉฐ, ํผ์ด๋๋ ์ค๋ ๋ ํ์ด ์๋ค์ด ๊ฒ์ด๋ค. ๋์, ๋ฐฉํฉํ์ฌ๋, ๊ทธ์ ์ด ์ฌ์ฅ์ ์๊ณ ๋์์ ํ๋ถํ๊ฒ ์๋ฆ๋ค์ฐ๋? ์ด์์ ๊ฐ์ด, ๋ด๋ฐ๋์ ์ด๋ ๋ฏธ๋ฌํ ๊ตณ์ธ๊ฒ ์ผ์์ด ๊ฐ์ง ์๋๋ค. ๋ ์นด๋ก์ฐ๋ ์ฒญ์ถ ์ผ๋ง๋ ๊ฐ์ง์ ์ฒญ์ถ์ ๊ฐ์น๋ฅผ ์ผ์์ ๊ณณ์ผ๋ก ์๋๋ค. ์ธ๊ฐ์ด ์ด์์ ๊ฑฐ์น ๊ทธ๋ฆฌํ์๋๊ฐ? ํ์์ผ๋ฉฐ, ํ์ ํ๊ฒ ์ฐ๋ฆฌ ๋์ค์ ์ฒญ์ถ ์ธ์์ ๋๊ณ , ์ฐพ์ ์ฌ๋ผ์ง์ง ์นผ์ด๋ค. ๋ฏธ๋ฌํ ๋ค์ด ์ฅ์ํ๋ ๋ชปํ๋ค ๊ฒ์ด๋ค. ์์ผ๋ฉด, ๊ฒ์ด๋ค.๋ณด๋ผ, ์ฒญ์ถ์์๋ง ์ญ์ฌ๋ฅผ ์ฝ๋ํ๋ค. ์ฌ๋ผ์ง์ง ๊ทธ๋ค์ ๊ธธ์ง ์๋ํ ํ์ผ๋ฉฐ, ๊ทธ๋ฆฌํ์๋๊ฐ?
ย ย ์ผ๋ง๋ ์ค์ฐ์์ ์ฐพ์๋ค๋
๋, ๊ทธ๋ค์ ์ด์, ๋ณด๋ผ. ๋๊น์ง ๊ณง ๋ ํผ๊ณ ๋ฃ๋๋ค. ๊ฐ์ผ๋ฉฐ, ๊ธด์ง๋ผ ์ผ๋ง๋ ๋ง์ด ๊ธธ์ง ๊ณ ํ์ ์๋๋ค. ๋์ด ๋งบ์ด, ํผ๊ฐ ๋จ๋ ํ๊ณ ๋ฟ์ด๋ค. ํ๋ถํ๊ฒ ๋ฐ๋ปํ ์ธ๊ฐ์ด ๋ฟ์ด๋ค. ์ค๋ ๋ ๋ ์นด๋ก์ฐ๋ ๊ดํ์
์ด๋ฉฐ, ํ๋ถํ๊ฒ ๋ฐ์ด๋ฉฐ, ๊ฐ์ฅ ์ผ๋ง๋ ๊ฐ์น๋ฅผ ๋ ์นผ์ด๋ค. ์๋ ํผ๊ฐ ๋๋ ค๋์, ์์ด ๊ทธ๊ฒ์ ํผ์ด๋๊ธฐ ๋ฐฉํฉํ์ฌ๋, ์ด๊ฒ์ ๊ฒ์ด๋ค. ์ญ์ฌ๋ฅผ ๋ฌด์์ด ํผ๊ณ ๋ฃ๋๋ค. ์์ผ๋ฉด, ๋์์ ํ ์ง๋ผ๋ ํ์์ผ๋ฉฐ, ์ผ๋ง๋ ๊ธธ์ง ์ฌ๋ง์ด๋ค. ๋ฐ๋ปํ ์๋ฝ๊ณผ ์๊ธ์ด๋ผ ์ฒญ์ถ์ ์ธ๊ฐ์ด ๊ฒ์ด๋ค.
ย ย
ย ย ๊ทธ๋ค์ ์์ ๋์ฐ์๋ ๋ณด๋ผ. ์ฌ๋ผ์ง์ง ์ฒญ์ถ ๋ฐ๋ปํ ์ธ์ธํ ๊ฒ์ด๋ค. ์ฌ์ฅ์ ์ฌ๋๊ฐ ๋ฌดํํ ๊ดํ์
์ด๋ฉฐ, ๋ด๋ ์ ๋ฌด์์ ๊ฒ์ด๋ค. ๋ชปํ ๊ฐ์ง ๊ทธ๋ค์ ํผ๊ณ ๊ทธ๋ค์ ๋ฌด์์ ๋ฃ๋๋ค. ๊ตฐ์๊ณผ ์ฉ๊ธฐ๊ฐ ๋ ์ปค๋ค๋ ์ผ์ ํ์ผ๋ฉฐ, ์์๋ ์ธ์ธํ๋ด? ์ฒญ์ถ์ ์ด๋ ๋ด๋ฐ๋์ ์ฒญ์ถ์ด ์ด๊ฒ์ ์๋๋ค. ์ ์ธ์์ ํ์ ์ฌ๋ง์ด๋ค. ์๊ฐ ์๋ ๋์ฐ์๋ ์ฌ๋์ ๊ฐ์น๋ฅผ ์ํ์ฌ, ์ธ๊ฐ์ ์ฐพ์๋ค๋
๋, ์์ผ๋ด? ์๋ฆ๋ต๊ณ ๋ฐฉํฉํ์์ผ๋ฉฐ, ์ธ์์ ๋ฐ๋ปํ ์ด์ ์นผ์ด๋ค.
ย ย </div>
ย ย <div>
ย ย ย ย <h1>Heading1 : h1</h1>
ย ย ย ย <h2>Heading2 : h2</h2>
ย ย ย ย <h1>Heading3 : h1</h1>
ย ย ย ย <h1>Heading4 : h1</h1>
ย ย ย ย <h1>Heading5 : h1</h1>
ย ย ย ย <h2>Heading6 : h2</h2>
ย ย ย ย <p>Heading7 : p</p>
ย ย ย ย <p>Heading8 : p</p>
ย ย ย ย <p>Heading9 : p</p>
ย ย </div>
</body>
</html>
html์ด์์
html๊ฐ๊ทนํ