Link pseudo-class (: hover) CSS background image flashing bug

Source: Internet
Author: User

Link pseudo-class (: hover) CSS background image flashing bug

 

This problem is often encountered during development. Here, we make a record for the emergency.

The link pseudo-class (: hover) CSS background image under IE6 has a flash bug, mainly because IE will request this image again, or the image is not cached.

For example:

CSS Code

A: hover {Background: URL (ImagePath )}

Common solutions:

Add the following IE6 special code at the bottom of the page to cache the CSS background image of IE6 to the local device. In this way, IE6 will no longer request to load the background image to the server during a: hover.

XML/html code

<! -[If IE 6]>

<SCRIPT type = "text/JavaScript">

Document.exe ccommand ("backgroundimagecache", false, true );

</SCRIPT>

<! [Endif]->

Or

XML/html code:

<! -[If IE 6]>

<SCRIPT type = text/JavaScript>

Try {

Document.exe ccommand ("backgroundimagecache", false, true );

}

Catch (ERR ){}

</SCRIPT>

<! [Endif]->

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.