CSS hack in IE6, IE7, firefox usage and distinction (1/2)

Source: Internet
Author: User
Tags wrapper

 

I. CSS HACK
The following two methods can solve almost all today's HACK.

1 ,! Important

With IE7! Important support ,! The important method is only for the HACK of IE6. (note the writing method. Remember to advance the declaration position .)

<Style>
# Wrapper
 {
Width: 100px! Important;/* IE7 + FF */
Width: 80px;/* IE6 */
 }
</Style>

 


2, IE6/IE77 for FireFox

* + Html and * html are unique tags of IE, which are not supported by firefox at the moment. * + html is also a unique tag of IE7.

<Style>
# Wrapper
 {
# Wrapper {width: 120px;}/* FireFox */
* Html # wrapper {width: 80px;}/* ie6 fixed */
* + Html # wrapper {width: 60px;}/* ie7 fixed, pay attention to the order */
 }
</Style>


 
 
] CSS hack: differentiate IE6, IE7, and firefox
Difference between different browsers, CSS hack writing:

Difference between IE6 and FF: background: orange; * background: blue;
Difference between IE6 and IE7: background: green! Important; background: blue;
Difference between IE7 and FF: background: orange; * background: green;
Difference FF, IE7, IE6: background: orange; * background: green! Important; * background: blue;
Note: IE can recognize *; standard browsers (such as FF) cannot recognize *; IE6 can recognize *, but not! Important and IE7 can recognize * and also! Important; FF cannot recognize *, but can recognize it! Important;
IE6 IE7 FF
* & Radic; ×
! Important × & radic;

 

Homepage 1 2 Last page
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.