λ°μν
HTMLμ μ μ μ νμλ₯Ό CSSμμ μ¬μ©νλ λ°©λ²μ λν΄ μμλ³΄κ² μ΅λλ€.
2024.12.22 - [β¨ UI/π HTML] - [HTML]μ νμ selector. id, class, name
#idλͺ { }
.classλͺ { }
π idμ class μ νμλ jqueryμμλ #μ .λ‘ λμΌνκ² μ¬μ©λκΈ°μ κΈ°μ΅ν΄λλ νΈμ΄ μ’μ΅λλ€.
μ νμ μ°μ μμ
- μμ± κ° λ€μ !importantλ₯Ό λΆμΈ μμ±
.important { color: red !important; }
- μΈλΌμΈ μ€νμΌ
<p style="color: blue;">This is a paragraph.</p>
- #idλ‘ μ§μ λ μμ±
#unique { color: green; }
- class, attribute, λ° pseudo-classλ‘ μ§μ λ μμ±
.class-name { color: purple; } input[name="reply"] { background-color: yellow; } a:hover { color: orange; }
- νκ·Έ μ΄λ¦(νμ
)μΌλ‘ μ§μ λ μμ±
p { font-size: 14px; }
κ·Έ μΈ μ νμλ€
μ νμ μ°μ μμκ° μκΈ°μ, λ λ€μν μ νμ μμ±λ²μ΄ μμ΅λλ€.
- * { }
μ 체 μ νμ
→ νλ©΄ λ΄ λͺ¨λ νκ·Έμ μν₯μ μ€λλ€. - tag > tag
μμμ νμ
→ νκ·Έ μμ μλ νκ·Έλ₯Ό μ°Ύμ μ νν©λλ€.- idκ° atμΈ μν°ν΄ μμ divκ° μλ€. λ κ·Έ μμ pνκ·Έκ° μλ€. μ΄κ²μ μ½λλ‘ λ§λ€λ©΄ #at>div>p{}κ° λλ€.
- #at > p{ } μ½λλ divνκ·Έ μμ μλ pνκ·ΈκΉμ§λ μν₯μ λ―ΈμΉμ§ λͺ»νκ³ , atμν°ν΄ νκ·Έ λ°λ‘ μμ μλ pνκ·Έμλ§ μν₯μ λ―ΈμΉλ€.
- tag tag
νμ μ νμtag tag μ€κ°μ >μμ΄ μ κ² λλ©΄ νμμ νμκ° λμ΄ pνκ·Έ μμ λ€μ΄κ°μλ span νκ·Έλ μν₯μ λ°λλ€. νλ§λλ‘ μμμ νμ>μ λ€λ₯΄κ² νκ·Έ μμ νκ·Έκ° λ€μ΄κ° μμ΄λ μν₯ λ°μ§ μλλ€. - tag[ ]
μμ± μ νμ- tag μμ± κ°μΌλ‘ μ§μ λ κ²λ€μ λ³κ²½ν μ μλ€.
- tag[id]{ }λ tagμμ±μ idκ° λ€μ΄κ° λͺ¨λ νκ·Έλ€μ λ³κ²½νκ³
- tag[id="μμ΄λλͺ "]{ }μ μ§μ λ μμ΄λλͺ μ΄ μ ν tagλ§ μμ λλ€.
- [attribute] : attributeλΌλ μμ±μ κ°μ§κ³ μλ μμλ€μ μ ν
- [attribute=value] : μμ±κ°κ³Ό μΌμΉνλ μμλ€μ μ ν
- [attribute~=value] : μμ±κ°κ³Ό μΌμΉνλ μμλ€μ μ ν, 곡백μΌλ‘ ꡬλΆνμ¬ ν¬ν¨λ μμ±κ°λ μ ν
- [attribute |= value] : μμ±κ°μΌλ‘ μμνλ μμλ€μ μ ν, νμ΄ν(-)μΌλ‘ ꡬλΆνμ¬ ν¬ν¨λ μμ±κ°λ μ ν
- [attribute ^= value] : μμ±κ°μΌλ‘ μμνλ μμλ€μ μ ν
- [attribute $= value] : μμ±κ°μΌλ‘ λλλ μμλ€μ μ ν
- [attribute *= value] : μμ±κ°μ ν¬ν¨νκ³ μμΌλ©΄ μ ν (μμΉ μκ΄ μμ)
- tag:
κ°μ ν΄λμ€ μ νμ
<article> <h3>κ°μ ν΄λμ€ μ νμ</h3> <ul> <li>νΉμ μ΄λ²€νΈκ° λ°μν νκ·Έ μ ν!</li> <li><a href="http://www.naver.com">λ€μ΄λ²</a></li> <li><a href="http://qclass.iptime.org:8686/kh/hangul.html">μκ³</a></li> <li><input type="checkbox" />체ν¬νλ©΄ ν¨κ³Ό μ μ©</li> </ul> </article>
- a:link{ }
→ ν΄λ¦μ ν°νΈμ€μ - a:visited{ }
→ λ§μ°μ€κ° μ¬λΌκ°μ λ - a:hover{ }
→ ν΄λ¦ν λ€ ν°νΈμμ&ν¬κΈ° - a:active{ }
→ aνκ·Έ μμ ν°νΈ ν¬κΈ° λ± μ§μ - input:checked{ }
→ inputνκ·Έ 체ν¬νμ λ μ€μ
- a:link{ }
- tag, tag, ...
κ·Έλ£Ήμμ±μ - tag.ν΄λμ€λͺ
μ’ μ μ νμ
λ°μν
'β¨ UI > π CSS' μΉ΄ν κ³ λ¦¬μ λ€λ₯Έ κΈ
[CSS]cssλ? μ μ©λ², μ£Όμ (0) | 2024.12.22 |
---|