Home > Web Front-end > CSS Tutorial > How to add comments to css style sheet

How to add comments to css style sheet

青灯夜游
Release: 2023-01-07 11:45:55
Original
5032 people have browsed it

In the css style sheet, you can use the "/* */" symbol to add comments. You only need to use "/*" and "*/" to wrap the content that needs to be commented. The syntax is "/* Comment content */"; CSS code in the style tag. In some older browsers, you can also use "<!-- -->" to add comments.

How to add comments to css style sheet

The operating environment of this tutorial: Windows 7 system, CSS3&&HTML5 version, Dell G3 computer.

CSS comments are used to add extra explanation to the code, or to prevent the browser from parsing CSS code within a specific area. 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.

/* 注释内容 */
Copy after login

Note:

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