여러 요소가 공통된 class
를 갖도록 할 수 있다.다음은 class 를 활용한 사례이다.
tomato 라는 class를 공통으로 갖고 있다.
<!DOCTYPE html>
<html lang ="ko">
<head>
<title>practice1</title>
<style>
body{
margin: 20px;
}
span{
background-color: green;
padding: 5px 10px;
margin: 10px;
}
.tomato{
background-color: tomato;
color: white;
padding: 5px 10px;
border-radius: 10px;
}
</style>
</head>
<body>
<span>Hello</span>
<span class="tomato">Hello</span>
<span>Hello</span>
<span class="tomato hello honey">Hello</span>
<span>Hello</span>
<span class="tomato">Hello</span>
</body>
</html>