Home  >  Article  >  Web Front-end  >  How to make single line comments in css

How to make single line comments in css

醉折花枝作酒筹
醉折花枝作酒筹Original
2021-04-23 18:05:163506browse

In CSS, you can use the "/*" and "*/" symbols to make single-line comments, and the syntax format is "/* Content to be commented */". Comments in CSS are usually used to explain the purpose of style rule declarations and help others understand how to handle style rules when editing style sheets. Browsers do not parse the content in comments.

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

Conventionally use // to comment single lines in CSS files. As a result, in IE, this line of definition is still considered valid, but in chrome, firefox, and safari, it is considered that this line has been commented out.

The correct comment is to use /* XXXXX */

/*设置Select样式*/
        .SelectList
        {
            height: 32px;
            line-height: 32px;
            overflow:hidden;
        }

Like the above code, the code included by /* */ will not be displayed on the web page.

Recommended learning: css video tutorial

The above is the detailed content of How to make single line comments in css. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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