[CSS Hack] IE6, IE7, IE8, and Firefox compatibility problems

Source: Internet
Author: User
Address: http://www.blogjava.net/qchong/archive/2010/02/24/313759.html
1. Differences between IE and non-ie browsers
# Tip
{

Background
:
Blue
;
 
/* Non-ie
Background colors
*/

Background
:
Red/9
;
 
/*
IE6, IE7, and IE8 background colors
*/


}


2. Differences between IE6, IE7, IE8, and FF

[Difference]: "/9", "*", and 」,「*」,「_」
[Example ]: # Tip
{

Background
:
Blue
;
 
/*
Firefox background turns blue
*/

Background
:
Red/9
;
 
/*
The IE8 background turns red
*/

* Background
:
Black
;
 
/*
IE7 black
*/

_ Background
:
Orange
;
 
/*
The IE6 background changes to orange
*/


}

[Note]: The Internet Explorer series can read "/9", Internet Explorer 6 and Internet Explorer 7 can read "*" (in meters), and Internet Explorer 6 can recognize "_" (bottom line ), therefore, you can write it down in order to make
The browser correctly reads the CSS syntax, so it can effectively differentiate ie versions and non-ie browsers (such as Firefox, opera, Google
Chrome, Safari, etc ).


3. Differences between IE6, IE7, and Firefox (method 1)

[Difference]: "*" and ]:「*」,「_」
[Example ]: # Tip
{

Background
:
Blue
;
 
/*
Firefox background turns blue
*/

* Background
:
Black
;
 
/*
IE7 black
*/

_ Background
:
Orange
;
 
/*
The IE6 background changes to orange
*/


}

[Note]: IE7 and IE6 can read "*", while IE6 can read "_" (bottom line), but IE7 cannot read 「_」, firefox (non-IE browser) is completely
"*" And "_" cannot be identified. Therefore, we can distinguish IE6, IE7, and Firefox by such differences.


4. Differences between IE6, IE7, and Firefox (method 2)

[Difference symbol ]:「*」,「! Important 」
[Example ]: # Tip
{

Background
:
Blue
;
 
/*
Firefox background turns blue
*/

* Background
:
Green! Important
;
 
/*
IE7 background turns green
*/

* Background
:
Orange
;
 
/*
The IE6 background changes to orange
*/


}

[Note]: IE7 can identify "*" and 「! Important, but IE6 can only recognize "*", but cannot recognize 「! Important ", Firefox can
Read 「! Important ", but cannot identify" * ". Therefore, we can effectively distinguish IE6, IE7, and Firefox by using these differences.


5. Differences between IE7 and Firefox

[Difference symbol ]:「*」,「! Important 」
[Example ]: # Tip
{

Background
:
Blue
;
 
/*
Firefox background turns blue
*/

* Background
:
Green! Important
;
 
/*
IE7 background turns green
*/


}

[Note]: Firefox can recognize 「! Important, but cannot identify "*", while IE7 can understand "*" and "!" at the same time 「*」,「! Important ", so you can
The two identifiers are used to separate IE7 and Firefox.


6. Differences between IE6 and IE7 (method 1)

[Difference]: "*" and ]:「*」,「_」
[Example ]: # Tip
{

* Background
:
Black
;
 
/*
IE7 black
*/

_ Background
:
Orange
;
 
/*
The IE6 background changes to orange
*/


}

[Note]: Both IE7 and IE6 can recognize "*", but IE6 can recognize "_" (bottom line), but IE7 cannot, the feature of "_" cannot be read through IE7, so that the feature can be separated easily.
The difference between IE6 and IE7.


7. Differences between IE6 and IE7 (method 2)

[Difference symbol ]:「! Important 」
[Example ]: # Tip
{

Background
:
Black! Important
;
 
/*
IE7 black
*/

Background
:
Orange
;
 
/*
The IE6 background changes to orange
*/


}

[Note]: Because IE7 can read 「! Important;
「! Important directly jumps to the next line to read CSS, so the background color is orange.


8. Differences between IE6 and Firefox

[Difference symbol ]:「_」
[Example ]: # Tip
{

Background
:
Black
;
 
/*
Firefox black
*/

_ Background
:
Orange
;
 
/*
The IE6 background changes to orange
*/


}

[Note]: IE6 can recognize "_" (bottom line), but Firefox cannot. Therefore, Firefox and IE6 can be separated by such differences to effectively achieve CSS.
Hack.

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.