The CSS Comments, are not displayed in the browser but they can help document your source code. CSS Comments are used to explain the code and make the program more readable and understandable.
They can be used single and span multiple lines and Begins with /* and end with */, and you can add as many comments to your stylesheet as you like.
Example 1: This example describes the single-line comment.
<!DOCTYPE html> <html> <head> <style> h1 { color: #f00; } /* Single line comment */ p{ color: #308d46; } </style> </head> <body> <h1>CSSHINT</h1> <p> A designer hub </p> </body> </html>
Output:
Example 2: This example describes the multi-line comment.
<!DOCTYPE html> <html> <head> <style> h1 { color: #f00; } /* This is a multi-line comment */ p{ color: #308d46; } </style> </head> <body> <h1>CSSHINT</h1> <p> A designer hub </p> </body> </html>
Output:
Example 3: This is HTML and CSS Comments.
<!DOCTYPE html> <html> <head> <style> h1 { color: #f00; } p { color: #f00; /* Set text color to red */ } </style> </head> <body> <!-- This is Heading Tag --> <h1>CSSHINT</h1> <p>A designer hub</p> </body> </html>
Output: