We all know that there are differences between browsers, and many people are using
Xhtml+cssThe way the web was made, it was a headache. It takes a lot of skill to work under the influence of these differences,
"Hide
CSS "is one of the most important techniques (even the most important). The main idea of this technique is to hide some overloads of some browsers in some way
CSSRules.
This article is not intended to teach you how to use this technique, it is intended for design developers with a certain CSS base, and I assume that you have used some kind of method of hiding CSS rules. Here is to make available methods and hidden rules of the browser are listed, so that everyone in the normal work at any time to consult.
In this big table list nine kinds of methods, I call it " lone solitary Nine Swords ", hope can help you busy :-D
Note: This form is originally loaded with w3development.de.
After reading this form, my first reaction was:Mozilla and Opera are really god-man. There is only one rule that will work for one of Opera 's oldest versions, so we're not thinking about Mozilla or opera when we talk about hidden rules. Here are the nine kinds of " sword " tricks, but also on the side of the note I personally recommend the use of the occasion. Note that my recommendation is not necessarily consistent with your needs, please check the above table before use.
@import URL ("")
@import url("global.css")
A browser hiding rule for older versions (with a number less than 5).
@import URL ()
@import url(global.css)
Browser hiding rules for older versions of the Windows platform (version number less than 5).
@import ""
@import "global.css"
Browser hiding rules for older versions of the Windows platform (version number less than 5).
Media= ""
Hides rules for Netscape 4.x .
@media
@media All {
Rules that need to be hidden */
}
If you only consider NN and IE , only the 4.x version of the hidden rules.
Comment
#anySelector/* */ { color:#f00; }
It's a precision-guided missile. Hides rules only for IE5 and the following versions. So if you want to define the rules separately from the IE5 and the IE5.5 , it depends on it.
Attribute
p[id] { color: # 0f 0; }
Another precision-guided missile. If you do not care about the old version of the browser, it is only for IE hidden rules. For more information about the property selector, see the documentation for the list.
Child
p>span { color: # 00f ; }
Basically, just the Mac platform part version of IE support this rule.
Tantek
P#tantek {
Some browsers have parsing bugs */
The following rules will be ignored */
Color: #f00;
}
Famous hidden CSS tricks, hidden rules for all " non-modern " browsers