Home > Web Front-end > CSS Tutorial > Introduction to three methods of comments in CSS

Introduction to three methods of comments in CSS

黄舟
Release: 2017-07-24 11:51:57
Original
2191 people have browsed it

Usually, if the CSS comment code is a single-line comment, it starts with /* and ends with */. Here we describe three methods of commenting in CSS code. I believe this article will definitely help you gain something.

Three ways to comment in CSS code

1. Selector (childselector)

If you want to hide a CSS definition in IE, you can use a child selector .

CSS comment code:

html>bodyp
{  
/*declarations*/  
}
Copy after login

2. "Wildcard" (*)

This writing method can only be understood by IE browser (hidden from other browsers)

CSS comment code:

*htmlp{  
/*declarations*/  
}
Copy after login

3. "Backslash" (\)

If you want IE/Win to be valid but IE/Mac to be hidden, you can use "backslash" "Skill.

CSS comment code:

/*\*/  
*htmlp{  
declarations  
}  
/**/
Copy after login

The above is the detailed content of Introduction to three methods of comments in CSS. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
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