Css multi-line comment method: First create a css sample file; then use the "/* text */" syntax to make multi-line comments. The comment code is such as "/* This is an example of a CSS multi-line comment */".
The operating environment of this tutorial: windows7 system, css3 version, DELL G3 computer.
The syntax for adding comments to css code is /* text */
Comments in CSS are usually used to explain the purpose of style rule declarations. It will help you and others understand how you handle style rules when editing style sheets. The browser does not display comments.
CSS comments start with /* and */.. See the example below:
/* 这是一行CSS注释 */ /* This is an example of a CSS multi-line comment */ body { font-family: Arial, sans-serif; } p { color: #333; line-height: 1.5; }
As you can see from the above code examples, CSS comment codes are divided into single-line comments and multi-line comments. , the annotation method is the same, using /* text*/ syntax for annotation.
Note: Once a comment mark is added, the comment part will not be executed or displayed, and will only be displayed in gray in the source code.
Recommended learning: "css video tutorial"
The above is the detailed content of How to write multi-line comments in css. For more information, please follow other related articles on the PHP Chinese website!