CSS Comments

CSS Comments

To explain a code, the CSS comments are used. It makes code easy to understand. Comments are not displayed by the browsers. Both the single or multiple lines statement 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>

Output:

Explanation:

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

Please Share