When IE7 does not recognize!important [Layout solution]_ Experience Exchange

Source: Internet
Author: User
Before IE7, we often use!important in the layout to solve the difference between IE and FF; But after the IE7 out,!important to IE7 will not work, and sometimes IE7 interpretation method and FF and IE6 different, then the new problem arises, with!important can solve IE6 but not solve IE7; This way you can see the same Web page in different browsers with different effects;

This is the day before the layout of a problem, you can first look at the effect; http://www.zishu.cn/blogview.asp?logID=553

or run the code below to see the same effect:
Copy CodeThe code is as follows:




<title>zishu.cn Test</title>





    • 64d/47 hitsPixu

    • 24d/35 hits scholar

    • 66d/87 hits revealed

    • 40d/34 hits Livid

    • 47d/56 hits Lao Meng

    • 42d/36hits Little Jade

    • 63d/67 hitsPixu






In this example, if I put
Program code
*+html #zishu_test li A:hover span {margin-left:-8px;} /* ie7*/
This line is deleted; then in the IE7, there will be a difference;

In order to solve this problem, I looked; a method inside the http://www.blueidea.com/tech/site/2006/3626.asp; But if the programmer and the layout are not the same person, such a method is very difficult to control; So there is the method below;

The following is the code;
Program code
Copy CodeThe code is as follows:
* HTML #zishu_test li a:hover span {margin-left:-8px;}/* IE6 */
*+html #zishu_test li A:hover span {margin-left:-8px;} /* ie7*/

This is the two methods for IE6 and IE7;
"*+html" is used by IE7 and ie5.01, and the distinction between IE7 and ie5.01 has a very simple method, is important, write important in front, so as to form a separate approach to IE7 hack.

Like what:

*+html Div. IE7 {
width:200px;!important;
width:100px;
}
  • 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.