Let IE6 also know!important

Source: Internet
Author: User

!important is generally used to distinguish between IE6 and Firefox, such as the basic hack method of browser. Because IE6 does not support!important, and Firefox can read!important, it changes the priority of the style. In fact IE6 in some cases, can also know!important.

For example:

<styletype= "Text/css">. Demo{Color:Red!important;Color:Green;}</style><Divclass= "Demo">Www.admin10000.com</Div>

The above code in the FF font is red, IE6 the font is green. Explain the existence of IE6 neglect!important.

Take a look again:

<styletype= "Text/css">. Demo{Color:Red!important; }. Demo{Color:Green; } </style> <Divclass= "Demo">Www.admin10000.com</Div> 

If IE6 does not recognize!important, the above code. The contents of the demo should be shown in green, but it is not,. The contents of the demo are shown in red, indicating that IE6 recognizes!important.

The difference between the two cases is: when in a selector, the use of!important to change the style priority, IE6 is not valid, the following style covers the front,!important is completely ignored, using!important hack is the use of this. And when applying!important in different selectors, IE6 recognize!important.

Let IE6 also know!important

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.