Open In App

How to include Comments in CSS Code ?

In CSS, Comments can be added to provide explanations, notes, or annotations within the code. Comments are helpful for code documentation and collaboration, providing insights into the purpose or usage of certain styles.

Note: Comments are ignored by the browser and do not affect the rendering of the webpage. There are two ways to include comments:



Single-line Comment

Single-line comments are initiated with /* and terminated with */. Anything between these symbols is treated as a comment.

/* This is a single-line comment */
.selector {
property: value; /* Another single-line comment */
}

Multi-line Comment

Multi-line comments start with /* and end with */, allowing for comments that span multiple lines.



/*
This is a
multi-line comment
*/
.selector {
property: value;
}
Article Tags :