CSS Comments
CSS comments are used to explain the code, and may help when you edit the source code at a later date. Comments are ignored by browsers.
A CSS comment is placed inside the <style> element, and starts with /* and ends with */. Comments can also span multiple lines.
Single-Line Comment
Example
css
p {
color: red; /* This is a single-line comment */
text-align: center;
}Multi-Line Comment
Example
css
/* This is
a multi-line
comment */
p {
color: red;
}You can also use comments to "comment out" code to temporarily disable it, which is useful for debugging.
Test Yourself with an Exercise
What is the correct syntax for a CSS comment?