CSS comments are used to explain a block of code or to make temporary changes during development. Comments are ignored by browsers. A comment are single line or multiple lines starts with /* and ends with */.
CSS does not support inline comments, like // in C or JavaScript. If you insert // before a property, that property will not be applied, looking like the comment worked. But in reality, CSS detected a syntax error and due to how it works it ignored the line with the error, and went straight to the next line. Knowing this approach lets you purposefully write inline comments, although you have to be careful because you can’t add random text like you can in a block comment.
Example:
h1 {
background-color: yellow;  
/* This is a single-line comment */
The CSS property names and many values are not case-sensitive. But, CSS selectors are usually case-sensitive, for example, the class selector .firstHeading is not the same as .firstheading. Therefore, to be on safer side, you should assume that all components of CSS rules are case-sensitive.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok