" to add comments in some older browsers."/> " to add comments in some older browsers.">
Home >Web Front-end >CSS Tutorial >How to add comments to css style sheet
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 "19791207a4e0a22c816ac020ecd8cae0" to add comments.
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.
/* 注释内容 */
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 c9ccee2e6ea535a969eb3f532ad9fe89 tag, in some older browsers you can also use 19791207a4e0a22c816ac020ecd8cae0
to comment the CSS code, although this is not possible recommended. Like most other programming languages that use the /* */
syntax for comments, comments cannot be nested. In other words, the first */
token after /*
will end the comment.
CSS comment writing specifications
1. Tips and label information comments
This is the most common way to comment, you can create it for yourself or other developers Leaving reminder information can avoid unnecessary confusion and trouble caused later. This simplicity of application is paramount.
.search{ border:1px solid #fff; /*Border Color*/ }
Note: There are 3 spaces between the comment content and the previous style statement, and 1 space after it
2. Modify the style comment (time and related personnel)
/*__Styles Updated: Thu 4.8.08 @ 5:15 p.m. Author: hour --------------------------------------------------------------------------------------------*/
3 , Document structure
/*__Header --------------------------------------------------------------------------------------------*/ .search{ border:1px solid #fff; /*Border Color*/ color:#333; /*Color*/} /*__Menu --------------------------------------------------------------------------------------------*/ .menul_ul{ border:1px solid #fff; /*Border Color*/}
Note: There is a blank line between two relatively independent paragraphs of content.
(Learning video sharing: css video tutorial)
The above is the detailed content of How to add comments to css style sheet. For more information, please follow other related articles on the PHP Chinese website!