Search

κΈ°λ³Έ μ„ νƒμž

κΈ°λ³Έ μ„ νƒμž

μ„ νƒμž μ’…λ₯˜
μ •μ˜
기호
μ˜ˆμ‹œ μ½”λ“œ
전체 μ„ νƒμž
λͺ¨λ“  μš”μ†Œλ₯Ό μ„ νƒν•˜λŠ” μ„ νƒμž
*
* { margin: 0; padding: 0; }
νƒœκ·Έ μ„ νƒμž
νŠΉμ • HTML νƒœκ·Έλ₯Ό μ„ νƒν•˜λŠ” μ„ νƒμž
νƒœκ·Έλͺ…
p { color: red; }
클래슀 μ„ νƒμž
νŠΉμ • 클래슀 이름을 가진 μš”μ†Œλ₯Ό μ„ νƒν•˜λŠ” μ„ νƒμž
.클래슀λͺ…
.button { background-color: blue; }
아이디 μ„ νƒμž
νŠΉμ • 아이디λ₯Ό 가진 μš”μ†Œλ₯Ό μ„ νƒν•˜λŠ” μ„ νƒμž
#아이디λͺ…
#header { background-color: green; }
κ·Έλ£Ή μ„ νƒμž
μ—¬λŸ¬ μ„ νƒμžλ₯Ό λ¬Άμ–΄ λ™μΌν•œ μŠ€νƒ€μΌμ„ 적용
μ„ νƒμž1, μ„ νƒμž2
h1, h2, h3 { color: purple; }
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>κΈ°λ³Έ μ„ νƒμž</title> <style> /* 전체 μ„ νƒμž : * */ * { margin: 0; padding: 0; box-sizing: border-box; } /* νƒœκ·Έ μ„ νƒμž : νƒœκ·Έμ΄λ¦„ */ body { font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif; } /* id μ„ νƒμž : #아이디 */ #title { font-size: 40px; /* fz40 */ margin-bottom: 20px; /* mb20 */ } /* class μ„ νƒμž : .클래슀 */ .btn { padding: 10px 12px; /* p10-12 */ text-decoration: none; /* tdn */ color: white; /* c:white */ background-color: royalblue; /* backco */ border-radius: 6px; /* borr */ } /* κ·Έλ£Ή μ„ νƒμž : μ„ νƒμž1, μ„ νƒμž2, ... */ .btn, .text { font-size: 16px; } p { margin: 20px; } </style> </head> <body> <h1 id="title">제λͺ© μž…λ‹ˆλ‹€.</h1> <a href="" class="btn">λ²„νŠΌ1</a> <a href="" class="btn">λ²„νŠΌ2</a> <a href="" class="btn">λ²„νŠΌ3</a> <a href="" class="btn">λ²„νŠΌ4</a> <a href="" class="btn">λ²„νŠΌ5</a> <p class="text">λ¬Έμž₯ μž…λ‹ˆλ‹€.</p> </body> </html>
HTML
볡사