κΈ°λ³Έ μ νμ
μ νμ μ’
λ₯ | μ μ | κΈ°νΈ | μμ μ½λ |
μ 체 μ νμ | λͺ¨λ μμλ₯Ό μ ννλ μ νμ | * | * { 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
볡μ¬