In CSS, a comment starts with /* and ends
with */. Comments can span multiple lines,
but may not be nested:
/* This is a single-line comment */
/* This is a comment that
spans multiple lines */
According to the CSS2 specification, comments that appear between
tokens won’t have any effect on the styles’ rendering. In practice,
however, we find comments causing errors in some older browsers in certain
The // comment syntax used in C++ is
not allowed. Neither are SGML comments that take the form
<!-- … -->, except in
one situation: they may appear in internal style sheets—style sheets
placed within the HTML source using the <style>
tag—in order to hide the CSS statements from pre-HTML4 user agents.
However, this use of comments is now redundant and can be disregarded.
See Linking CSS to a Web Document for further information.
To post a note on this topic, please log in
with your SitePoint username and password. If you don't have an account yet, you can
create a new account for free.