Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What are the compatibility issues of IE6, IE7, IE8, Firefox and CSS HACK

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article is about IE6, IE7, IE8, Firefox compatibility and CSS HACK issues. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

1. Distinguish between IE and non-IE browser CSS HACK code

# {

Background:blue; / * non-IE background shading * /

Background:red\ 9; / * IE6, IE7, IE8 background color * /

}

two。 Distinguishing IE6,IE7,IE8,FF CSS HACK

[distinguishing symbol]: "\ 9", "*", "_"

[example]:

# {

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

Background:red\ 9; / * IE8 background turns red * /

* background:black; / * IE7 background turns black * /

_ background:orange; / * IE6 background turns orange * /

}

[description]: because IE browsers can read "\ 9", while IE6 and IE7 can read "*" (meter font), and IE6 can recognize "_" (bottom line), it can be written down in order, so that browsers can read it correctly and understand CSS syntax, so they can effectively distinguish between IE versions and non-IE browsers (such as Firefox, Opera, Google Chrome, Safari, etc.).

3. Distinguish between IE6, IE7, Firefox (EXP 1)

[distinguishing symbol]: "*", "_"

[example]:

# {

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

* background:black; / * IE7 background turns black * /

_ background:orange; / * IE6 background turns orange * /

}

[description]: IE7 and IE6 can read "*" (meter font), IE6 can read "_" (bottom line), but IE7 can not read "_", and Firefox (non-IE browser) can not recognize "*" and "_" at all, so IE6, IE7 and Firefox can be distinguished by such differences.

4. Distinguish between IE6, IE7, Firefox (EXP 2)

[distinguishing symbol]: "*", "! important"

[example]:

# {

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

* background:green! important; / * IE7 background turns green * /

* background:orange; / * IE6 background turns orange * /

}

[description]: IE7 can identify "*" and "! important", but IE6 can only identify "*" but not "! important". As for Firefox, it can read "! important" but cannot recognize "*" so it can effectively distinguish IE6, IE7 and Firefox through such differences.

5. Distinguish between IE7 and Firefox

[distinguishing symbol]: "*", "! important"

[example]:

# {

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

* background:green! important; / * IE7 background turns green * /

}

[description]: because Firefox can recognize "! important" but not "*", while IE7 can understand "*" and "! important" at the same time, two identifiers can distinguish IE7 from Firefox.

6. Distinguish between IE6 and IE7 (EXP 1)

[distinguishing symbol]: "*", "_"

[example]:

# tip {

* background:black; / * IE7 background turns black * /

_ background:orange; / * IE6 background turns orange * /

}

[description]: both IE7 and IE6 can identify "*" (meter font), but IE6 can identify "_" (bottom line), but IE7 can not. The difference between IE6 and IE7 can be easily distinguished by the fact that IE7 cannot read "_".

7. Distinguish between IE6 and IE7 (EXP 2)

[distinguishing symbol]: "! important"

[example]:

# {

Background:black! important; / * IE7 background turns black * /

Background:orange; / * IE6 background turns orange * /

}

[description]: because IE7 can read "! important;" but not IE6, and the reading step of CSS is from top to bottom, IE6 can not recognize "! important" and skip to the next line to read CSS, so the background color will appear orange.

8. Distinguish between IE6 and Firefox

[distinguishing symbol]: "_"

[example]:

# {

Background:black; / * Firefox background turns black * /

_ background:orange; / * IE6 background turns orange * /

}

[description]: because IE6 can identify "_" (bottom line), but Firefox is not, it can distinguish between Firefox and IE6 through such differences, and effectively achieve CSS hack.

Thank you for reading! This is the end of this article on "IE6, IE7, IE8, Firefox compatibility CSS HACK issues". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report