In this post, we will learn how to write comments in CSS. CSS comment helps to understand the style rules. Comments are not executed by the browsers so we are not seen comments. Comments are very useful to find any specific code very quickly. So we should make habit to writing comments.

How To Write Comments in CSS ?

Write Comments in CSS

To write comments in CSS we use this syntax /* This is CSS Comment */

We can use this syntax for both single line comment or multiline comment. This CSS comment start with /* and ends with */ .


Examples of CSS comment is as follows:

<!DOCTYPE html>
<title>How To write Comments in CSS ?</title>

/* This is an example of a single line CSS Comment */

/* This is an example of
a multi line CSS Comment */

h1 {color: red};


<h1>CSS Comments Examples</h1>

</html> code-box


In this post we learned how to write comments in CSS. You try to make it yourself. I hope you make. If you face any problem, then comment and tell us. Keep visiting the blog to read more similar posts.

Post a Comment

Previous Post Next Post