CSS Comments

Comments in CSS

CSS Comments are used to explain your code, and may help you when you edit the source code later. Comments are ignored by browsers.

Comments are single or multiple lines statement and written within /*…………*/.

Example:

<!DOCTYPE html>
<html>
<head>
<style>
p {
    color: blue;
    /* This is a single-line comment */
    text-align: center;
} 
/* This is
a multi-line
comment */
</style>
</head>
<body>
<p>Hello Learner's</p>
<p> /* This is a single-line comment */</p>
<p>/* This is
a multi-line
comment */</p>
</body>
</html>

Output:

Hello Learner's

       /*This statement is styled with CSS.*/
      /* This is a multi-line comment */

Recommended Posts:

Spread the love

Leave a Comment

Your email address will not be published. Required fields are marked *