
<head>
<link rel="stylesheet" href="./style.css">
<title>Practice</title>
</head>
<body>
<h1>Example</h1>
<h2>Fruit</h2>
<ul class="first-list-id" id="first-list-id">
<li class="first-item-class" id="first-item-id">apple</li>
<li class="second-item-class" id="second-item-id">banana</li>
</ul>
</body>
//index.html
ul {
margin-left: 0;
color: rgb(255, 0, 0);
}
.first-item-class {
color: rgb(0, 255, 0);
}
#first-item-id {
color: rgb(4, 0, 255);
}
#second-item-id {
color: rgb(230, 0, 255);
}
//style.css

Cascading의 우선순위에 따라 색상이 적용된 것을 확인 할 수 있다.

Naver 웹 페이지에서 개발자 모드를 통해 html과 css를 살펴 보았다.

head 태그 안에 선언되어있는 css 파일을 지웠을 때, 해당 화면과 같이 서식들이 깨진 것을 확인 할 수 있다.