CSS compatibility issues, for a single browser

Source: Internet
Author: User

CSS Hack for Firefox:

@-moz-document Url-prefix () {. selector {attribute:value;}}
2

CSS Hack for WebKit kernel and Opera browser:

@media all and (min-width:0) {. selector {attribute:value;/forWebKit and opera/}}
3

From this style we can only distinguish the WebKit kernel browser and opera browser from other browsers, but we cannot distinguish between them, so we also need to add a style to the above style:

@media screen and (-webkit-min-device-pixel-ratio:0) {. selector {attribute:valueforwebkit;/=webkit/} }
4

Since this style is for WebKit, the previous style will be overwritten, so, through these two styles can distinguish between WebKit and opera, opera's attribute value takes Value,webkit attribute value to take valueforwebkit.
5

In fact, as a general rule, we generally deal with the compatibility problem on IE, but when faced with the need to deal with Firefox or Chrome compatibility issues, be sure to check the structure of the Web page is reasonable and the use of notes is standard, until forced to use the above CSS Hack.

CSS compatibility issues, for a single browser

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.