CSS notation for different browsers such as Ie6,ie7,ie8,ie9,ff

Source: Internet
Author: User

First of all, we introduce the principle of hack, that is, different browsers to identify different characters

Common special character recognition tables in CSS:

(1) *: IE6+IE7 can recognize *, and standard browser FF+IE8 is not recognized *;

(2)!important: Except IE6 can not recognize!important, FF+IE8+IE7 can identify!important;

(3) _: In addition to IE6 support _, Ff+ie8+ie7 are not supported _;

(4) \9: All IE browsers are recognized (IE6, IE7, IE8, IE9)

Example:

(1) difference between FF (IE8) and IE6 IE7

Backgorund:orange; FF and IE8 background color will be orange

*backgorund:red; IE6 and IE7 background color will be red

(2) difference between FF (IE8) and IE6 and IE7

Background:orange; FF and IE8 background color will be orange

*background:red!important; IE7 background color will be red

*background:blue; IE6 background color will be blue

(3) difference between FF (IE8) and IE6 and IE7

Background:orange; FF and IE8 background color will be orange

*background:red; IE7 background color will be red

_background:blue; IE6 background color will be blue

(4) difference between FF and IE6 IE7 IE8 IE9

Color:gray; Non-IE browser font color will be gray in FF

color:red\9; IE8 IE9 font color will be red

*color:green; IE7 font color will be green

_color:blue; IE6 font color will be blue

Hint: CSS hack writing order: first write FF and other non-IE browser required style, followed by write IE8 required style, then IE7, then IE6!

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.