6-7. CSS κΈ°μ΄ μ°μ΅λ¬Έμ 1,2,3
2021. 10. 12. 23:41γHTML + CSS + JS
728x90
* μ°μ΅λ¬Έμ 1
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>μ°μ΅λ¬Έμ 1</title>
<style>
#container {
width:350px;
margin:30px auto;
}
img {
border: 1px solid #ccc;
border-radius: 50%;
box-shadow: 5px 5px 30px 2px #000;
}
</style>
</head>
<body>
<div id="container">
<img src="images/bear.jpg" alt="κ³°μΈν μ¬μ§">
</div>
</body>
</html>
* μ°μ΅λ¬Έμ 2
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<title>μ°μ΅λ¬Έμ 2</title>
<style>
section{
width:800px;
margin: 0 auto;
}
h2{
font-size:1.5em;
}
h3 {
font-size:1.0em;
}
p {
line-height:20px;
font-size:12px;
}
footer {
width:100%;
height:50px;
background-color:#222;
clear: left;
}
footer > p {
color:#fff;
font-size:0.9em;
text-align: center;
line-height:50px;
}
article {
float: left;
width: 350px;
height: 200px;
margin: 10px;
padding: 10px;
border: 1px solid #ccc;
}
</style>
</head>
<body>
<section>
<h2>κ°μμ§ μ©ν μ€λΉνκΈ°</h2>
<article class="at1">
<h3>κ°μμ§ μ§ </h3>
<p>κ°μμ§κ° νΈν μ΄ μ μλ ν¬κ·Όν μ§μ΄ νμν©λλ€. κ°μμ§μ μ§μ κ°μμ§κ° λ€ ν° νμλ κ³μ μΈ μ μλ μ§μΌλ‘ ꡬμ
νμΈμ.μ§μ ꡬμ
νμ€ λλ λ°μμ§μ΄ μ λμ΄ μλμ§, μΈνμ΄ κ°νΈν μ νμΈμ§ κΌ νμΈνμκ³ κ³ λ₯΄μλ κ²μ΄ μ’μ΅λλ€.</p>
</article>
<article class="at2">
<h3>κ°μμ§ λ¨Ήμ΄ </h3>
<p>κ°μμ§μ λ¨Ήμ΄λ κΌ μ΄λ¦° κ°μμ§μ©μΌλ‘ λμμλ μ¬λ£λ₯Ό μ ννμΈμ. κ°μμ§λ€μ μ¬λμ λΉν΄ μ±μ₯μλκ° 8λ°°μ λ λΉ λ₯΄λ΅λλ€. λ°λΌμ κ°μμ§μκ²λ μ±μ₯μλμ λ§λ μ¬λ£λ₯Ό κΈμ¬νμ
μΌ ν©λλ€. μ¬λμ΄ λ¨Ήλ μμμ λ¨Ήκ² λλ©΄ μλ
κ³Ό ν₯μ λ£μ μ
λ§μ΄ μ΅μν΄μ§κ³ , λΉλ§μ΄ λ κ°λ₯μ±μ΄ λ§€μ° λμμ§λλ€. κ°μμ§μ© μ¬λ£λ μν 12κ°μκΉμ§ κΈμ¬νμ
μΌ ν©λλ€.</p>
</article>
<article class="at3">
<h3>λ°₯κ·Έλ¦, λ¬Όλ³ </h3>
<p>λ°₯κ·Έλ¦μ μ½κ² λμ΄μ§μ§ μλλ‘ λ°λ₯μ΄ λμ κ²μ΄ μ’μ΅λλ€.λ¬Όλ³μ λλ‘±μ΄ λ¬λ¦° κ²μΌλ‘ μ ννμΈμ. λ°₯κ·Έλ¦μ λ¬Όμ μ£Όκ² λλ©΄ μ
μ£Όλ³μ νΈμ΄ λͺ¨λ μ κΈ° λλ¬Έμ λΉμμμ μ΄λ―λ‘ λλ‘±μ ν΅ν΄μ λ¬Όμ λ¨Ήμ μ μλ λ¬Όλ³μ λ§λ ¨νμλ κ²μ΄ μ’μ΅λλ€.</p>
</article>
<article class="at4">
<h3>μ΄λ¦ν, λͺ©μ€</h3>
<p>κ°μμ§λ₯Ό μμ΄λ²λ¦΄ μΌλ €κ° μμΌλ μ°μ±
ν λ¬΄λ ΅μ΄ λλ©΄ μ΄λ¦νλ₯Ό κΌ λͺ©μ κ±Έμ΄μ£Όλλ‘ νμΈμ. κ·Έλ¦¬κ³ λ°©μΈμ΄ λ¬λ¦° λͺ©κ±Έμ΄λ₯Ό νκ³ μ νμ€ λλ μ μ€νμ
μΌ ν©λλ€. μμ§μΌ λλ§λ€ λ°©μΈμ΄ λΈλ 거리면 μ κ²½μ΄ μλ―Όν κ°μμ§λ€μκ²λ μ’μ§ μμ μν₯μ λΌμΉ μ μκΈ° λλ¬Έμ
λλ€.</p>
</article>
<footer>
<p>boxmodel μ°μ΅νκΈ°</p>
</footer>
</section>
</div>
</body>
</html>
* μ°μ΅λ¬Έμ 3
<!DOCTYPE html>
<html lang="ko">
<head>
<meta charset="UTF-8">
<title>μ°μ΅λ¬Έμ 3</title>
<style>
a:link, a:visited {
color:black;
text-decoration: none;
}
a:hover {
background-color:#000;
color:#fff;
}
ul {
list-style: none;
}
li {
float: left;
}
a {
display: block;
padding: 10px 20px;
background-color: #ccc;
}
</style>
</head>
<body>
<nav>
<ul>
<li><a href="#">λ©λ΄1</a></li>
<li><a href="#">λ©λ΄2</a></li>
<li><a href="#">λ©λ΄3</a></li>
<li><a href="#">λ©λ΄4</a></li>
</ul>
</nav>
</body>
</html>
728x90