How to write multi-line comments in css

藏色散人
Release: 2023-01-03 09:30:15
Original
3019 people have browsed it

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 */".

How to write multi-line comments in css

The operating environment of this tutorial: windows7 system, css3 version, DELL G3 computer.

The syntax for adding comments to css code is /* text */

How to write multi-line comments in css

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;
}
Copy after login

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!

Related labels:
css
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template