Hide CSS for browsers

Source: Internet
Author: User

We all know that there are differences between browsers.XHTML + CSSThis was a headache for Web pages. A lot of skills are required to work under the influence of these differences,"HideCSS"Is a very important technique (or even the most important ). The main idea of this technique is to hide some overloadedCSSRules.

This articleArticleIt is not intended to teach you how to use this technique.CSSFor basic design developers, I assume that you have used some kind of hidingCSSRule method. Here we want to list available methods and browsers with hidden rules so that you can check them at any time during normal work.

Nine methods are listed in this large table."An exclusive sword", Hope to help you

Note: This table is originalW3development.de.

After reading this table, my first response is:MozillaAndOperaThey are really gods. Only one rule willOperaThe oldest version works, so we will not consider hiding rules later.MozillaAndOpera. The nine types are listed below"Jianfa"I also noted the use cases I personally recommended. Note that the recommended items do not necessarily match your requirements. before using them, check the table above.

@ Import URL ("")

@ Import URL ("global.css ")

For earlier versions (versions earlier5.

@ Import URL ()

@ Import url(global.css)

PairWindowsOld version of the platform (version number less5) The browser hides the rule.

@ Import ""

@ Import "global.css"

PairWindowsOld version of the platform (version number less5) The browser hides the rule.

Media = ""

<Link href = "global.css" type = "text/CSS" rel = "stylesheet" Media = "all"/>

PairNetscape 4.xHide rules.

@ Media

 
@ Media all {

 
.../*Rules to be hidden*/

 
}

If you only considerNnAndIEOnly4. xVersion hiding rules.

Comment

# Anyselector/**/{color: # f00 ;}

This is a precise missile. Only pairIe5And later versions. So if you wantIe5AndIe5.5Define rules separately.

Attribute

P [ID] {color :# 0f 0 ;}

Another precise missile. If you do not care about the old browser versionIEHide rules. For more information about the attribute selector, seeW3CDocumentation.

Child

P> span {color :# 00f ;}

Basically the same as above,MacPlatform versionIEThis rule is supported.

tantek

  P # tantek {

voice-family :"\"}\""; /* Some browsers parse bugs */

voice-family: Inherit; /* */

    color: # f00; 

}< P>

famous CSS technique, hide rules for all " non-modern " browsers

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.