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
๋ณต์‚ฌ