반응형
Class명은 유일할 필요가 없다.
그리고 여러 요소들을 같이 쓸 수 있고, 한 번에 여러 class가 쓰일 수 있다.
<!DOCTYPE html>
<html lang="kr">
<head>
<title>The Nick Times</title>
<style>
body {
margin: 20px;
}
span {
background-color: teal;
}
.tomato {
background-color: tomato;
}
</style>
</head>
<body>
<span>hello</span>
<span class="tomato"> hello</span>
<span>hello</span>
<span class="tomato">hello</span>
<span>hello</span>
<span class="tomato">hello</span>
<span>hello</span>
</body>
</html>
결과
칙칙폭폭 귀여운 기차같아
반응형
'2. CSS' 카테고리의 다른 글
CSS inline-block 태그 사용하기 (0) | 2024.11.19 |
---|---|
CSS Class(클래스) 태그 간단하게 줄이기 (0) | 2024.11.18 |
CSS inline의 margin(마진)은 좌우로만 가질 수 있다. (0) | 2024.11.18 |
CSS Border 의 성질 (0) | 2024.11.18 |
CSS Border 태그 (0) | 2024.11.18 |