CSS compatible with IE6, IE7, IE8, and Firefox browser methods

Source: Internet
Author: User
Tags readable relative

This article to give you a brief description of div+css relative IE6 IE7 and IE8 compatibility issues, focus on the IE6 IE7 and IE8 and other browser differences and contacts, I believe this article will let you have some harvest.

Div+css relative IE6 IE7 and IE8 compatibility problem collation

1. Distinguish IE and non ie browsers

The following is a code fragment:

#tip {

background:blue;/* Non IE background color * *

Background:red9;/*ie6, IE7, IE8 background color * *

}

2. Difference Ie6,ie7,ie8,ff

"Difference symbol": "9", "*", "_"

"Sample":

The following is a code fragment:

#tip {

Background:blue;/*firefox Background to Blue * *

BACKGROUND:RED9;/*IE8 Background Red * *

*BACKGROUND:BLACK;/*IE7 Background Change Black * *

_BACKGROUND:ORANGE;/*IE6 Background Change Orange * *

}

"description": Because the IE series browser can read "9", and IE6 and IE7 readable "*" (m), IE6 can be recognized "_" (bottom line), so you can write down in order, it will allow the browser to read the correct view of their own CSS syntax, So it can effectively differentiate IE versions and non ie browsers (like Firefox, Opera, Googlechrome, Safari, etc.).

3. Distinguish IE6, IE7, Firefox (Method 1)

"Difference symbol": "*", "_"

"Sample":

The following is a code fragment:

#tip {

Background:blue;/*firefox Background to Blue * *

*BACKGROUND:BLACK;/*IE7 Background Change Black * *

_BACKGROUND:ORANGE;/*IE6 Background Change Orange * *

}

"description": IE7 and IE6 readable "*" (m), IE6 can read "_" (bottom line), but IE7 can't read "_", as for Firefox (non IE browser) is completely unable to identify "*" and "_", so you can distinguish between IE6, IE7, Firefox

4. Distinguish IE6, IE7, Firefox (Method 2)

"Difference symbol": "*", "!important"

"Sample":

The following is a code fragment:

#tip {

Background:blue;/*firefox Background to Blue * *

*BACKGROUND:GREEN!IMPORTANT;/*IE7 Background Change Green * *

*BACKGROUND:ORANGE;/*IE6 Background Change Orange * *

}

"description": IE7 can identify "*" and "!important", but IE6 can only identify "*", but cannot identify "!important", as Firefox can read "!important" but cannot identify "*" So the difference can be used to effectively partition IE6, IE7, Firefox.

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.