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

Introduction to three methods of comments in CSS

黄舟
黄舟Original
2017-07-24 11:51:572168browse

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

2. "Wildcard" (*)

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

CSS comment code:

*htmlp{  
/*declarations*/  
}

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

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!

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