가독성을 높이고 이해하기 쉽게 만들기 위해 CSS 선언에 대한 주석을 작성할 수 있습니다. CSS는 내용이 별표로 묶인 슬래시로 시작하고 끝나는 주석에 대해 C 언어 스타일 구문을 따릅니다. /**/ 안에 작성된 모든 선언은 무시됩니다.
구문
CSS 주석의 구문은 다음과 같습니다 -
/*Comments*/
다음 예는 CSS 주석을 보여줍니다 -
예시
<!DOCTYPE html>
<html>
<head>
<style>
ul {
list-style: none; /*To remove the solid circles*/
}
</style>
</head>
<body>
<ul>
<li>Σ1</li>
<li>Σ2</li>
<li>Σ3<li>
</ul>
</body>
</html> 출력
이것은 다음과 같은 출력을 제공합니다 -

예시
<!DOCTYPE html>
<html>
<head>
<style>
div {/*this <div> selects all >div> elements and the declares the following*/
margin: 8px;
float: left;
width: 100px;
height: 100px;
/*border: 2px solid black;*/
/*removed border*/
background-color: lightpink;
}
div + div { /*this makes a circle*/
border-radius: 50%;
}
</style>
</head>
<body>
<div></div>
<div></div>
</body>
</html> 출력
이것은 다음과 같은 출력을 제공합니다 -
