If you are new to CSS, this is true essential for you. The CSS comment syntax. It’s great practice to use comments, even if your stylesheet isn’t too long. After some time, when you will be coming back to your code, they will simply explain your past thoughts. CSS syntax is similar to C, C++, etc. comment syntax.
Inline CSS comments
Inline comments are the most common used. They look like:
/*This is inline comment.*/
You can use the wherever in your stylesheet:
#header { /*header div*/ width: auto; } /*Classes*/ .heading { color: olive; }
Multi-line CSS comments
Sometimes, you need to add more than a word or two to your code. If you need to add longer comment, you should use multi-line comment syntax, which is:
/*This is multi-line comment.*/
Remember, that multi-line comments close everything between /* and */ into comment, so any code between /* and */ won’t be considered. You can easily comment CSS code like this:
#header { width: auto; } /* .heading { color: olive; } */