<span style="color: red;"> 하나</span>
<span style="color: green;">둘</span>
<span style="color: blue;">셋</span>
테스트
하나
둘
셋
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>테스트</title>
<style>
#one { color: red;}
#three { color: blue;}
.spa { color: green;}
</style>
</head>
<body>
<span id="one"> 하나</span>
<span class="spa">둘</span>
<span id="three" class="spa">셋</span>;
</body>
</html>
테스트
하나
둘
셋;
우선순위가 id, class, tag 순으로 id가 가장 높아서 three가 green이 아닌 blue로 출력
test.css 파일 내용
#one { color: red;}
#three { color: blue;}
.spa { color: green;}
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>테스트</title>
<link rel="stylesheet" href="test.css">
</head>
<body>
<span id="one"> 하나</span>
<span class="spa">둘</span>
<span id="three" class="spa">셋</span>;
</body>
</html>