색상
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>색상 스타일</title>
<style>
/* 태그 선택자 */
h1 { color: deepskyblue; }
h3 { color: blue; }
.box {
background-color: orange;
border: 2px solid red;
padding: 40px 20px;
}
.font {
color: brown;
font-weight: bold;
font-size: 14px;
}
.site {
color: black;
text-decoration: none;
}
a {
color: inherit; /* 상위요소 스타일 상속 */
text-decoration: inherit;
}
</style>
</head>
<body>
<h1>색상 스타일</h1>
<h3>배경색</h3>
<div class="box">
BOX
</div>
<h3>폰트 색상</h3>
<p class="font">
폰트 색상을 적용해봅니다.
</p>
<p class="site">
<a href="https://www.알클.com">www.알클.com </a>
</p>
</body>
</html>
HTML
복사




