JavaScript Tutorial

CSS Comments

Comments are the content that helps the developer to understand the code at a later stage. They are always ignored by browsers.

There are no restrictions as to where to put a comment. Here is an example to explain using single-lined and multi-line comments.

/* This is a single-line comment /

p {

color: red;

 / This is an inline comment */

font-size: 16px;

}

/* This is a

multi-line

comment */

h1 {

color: blue;

font-size: 24px;

}

Go back to Previous Course