CSS Comments

To explain a code, CSS comments are used. It makes code easy to understand. Comments are not displayed by the browsers. Both the single or multiple lines statements are written within the /*…………*/ in CSS.

Example:

<!DOCTYPE html>
<html>
<head>
<style>
h3 {
color: crimson;
/* I am a single-line comment */
text-align: center;
}
/* I am
a multi-line
comment */
</style>
</head>
<body>
<h3>Hello World!!</h3>
<h3>Today is a great day.</h3>
</body>
</html>

Explanation:

In the above example, we displayed the use of both single or multiple-line comments in CSS.

Please follow and like us:
Content Protection by DMCA.com