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
볡사

κ²Œμ‹œνŒ κΈ€μ“°κΈ°

<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>κ²Œμ‹œνŒ κΈ€μ“°κΈ°</title> <style> /* 전체적인 λ ˆμ΄μ•„μ›ƒ */ body { font-family: Arial, sans-serif; background-color: #f5f5f5; margin: 0; padding: 0; } .container { width: 80%; max-width: 800px; margin: 50px auto; padding: 20px; background-color: #fff; box-shadow: 0 0 10px rgba(0,0,0,0.1); } /* 제λͺ© μŠ€νƒ€μΌ */ h1 { text-align: center; color: #333; } /* 폼 μŠ€νƒ€μΌ */ .form-group { margin-bottom: 15px; } label { display: block; font-weight: bold; margin-bottom: 5px; } input[type="text"], textarea { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; box-sizing: border-box; } button { width: 100%; padding: 10px; background-color: royalblue; color: white; border-radius: 4px; border: none; cursor: pointer; font-size: 16px; } button:hover { background-color: #0056b3; } </style> </head> <body> <div class="container"> <h1>κ²Œμ‹œνŒ κΈ€μ“°κΈ°</h1> <form action="" method="post"> <div class="form-group"> <label for="title">제λͺ©</label> <input type="text" id="title" name="title" required> </div> <div class="form-group"> <label for="writer">μž‘μ„±μž</label> <input type="text" id="writer" name="writer" required> </div> <div class="form-group"> <label for="content">λ‚΄μš©</label> <textarea name="content" id="content" rows="10" required></textarea> </div> <div class="form-group"> <button type="submit">μž‘μ„±ν•˜κΈ°</button> </div> </form> </div> </body> </html>
HTML
볡사