Home>Article>Web Front-end> How to comment in css
You can use the "/* */" symbol to comment in CSS. Comments can be written in any position that allows spaces in the style sheet. Comments can be written in one line or multiple lines. The comment syntax is such as "/ * Comment */".
The operating environment of this article: Windows 7 system, CSS3 version, Dell G3 computer.
How to comment in css?
CSS comments
CSS comments are used to add additional explanations to the code, or use To prevent browsers from parsing CSS code in specific areas. Comments have no effect on document layout.
Syntax
Comments can be written anywhere in the style sheet where spaces are allowed. Comments can be written on one line or on multiple lines.
/* Comment */
Example
/* 这是一行单行注释 */ /* 分为 几行 的 注释 */ /* 下面的注释用于禁用特定的样式 */ /* span { color: blue; font-size: 1.5em; } */ Copy to Clipboard
Description
/* */ style comment syntax can be used as a single-line comment or as a multi-line comment. There is no other way to declare annotations in an external, standalone CSS file. However, if the CSS code is written in the c9ccee2e6ea535a969eb3f532ad9fe89 tag, in some older browsers you can also use 19791207a4e0a22c816ac020ecd8cae0 to comment the CSS code, although this is not recommended. Like most other programming languages that use the /* */ syntax for comments, comments cannot be nested.
In other words, the first */ mark after /* will end the comment.
Recommended learning: "css video tutorial"
The above is the detailed content of How to comment in css. For more information, please follow other related articles on the PHP Chinese website!