CKTIS / CSS
CSS comments
A CSS comment uses /* ... */ and can span multiple lines. Use comments to explain code or temporarily disable declarations, but remember that comments cannot be nested.
Version: CSS modules; structured CSSWG indexes reconciled with pinned MDN BCD; Chromium 152 scope gate, per-example verification still required
Syntax
/* ... */A /* ... */ comment starts with /* and ends at the first */. It can occupy one or multiple lines. Its contents produce no CSS tokens.
Comments cannot nest: an inner /* does not open another level. Omitting the closing */ consumes the rest of the file and causes a parse error. // does not start a CSS comment.
Place comments between tokens rather than splitting names or values: co/**/lor does not become color. In the example, the commented-out color: red; has no effect, while the active color: blue; makes the text blue.
Examples
<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>CSS comments</title>
<style>
/* A comment can span
multiple lines. */
p {
/* color: red; */
color: blue;
}
</style>
<p>Comments work.</p>
</html>Result
Comments work.
The displayed code and declared result were verified in an isolated environment using the method recorded in the verification evidence for this exact version.