Iepngfix. HTC and png8 make IE6 support PNG background transparent

Source: Internet
Author: User

In the process of creating a website for customers, one of the most difficult problems is to process the background transparency problem of PNG images, because it is troublesome to be compatible with different browsers.

After a long time, I finally found a solution.Iepngfix. HTC.

Iepngfix. How to Use HTC:

    1. Download the script and decompress iepngfix.htcand blank.gif to the appropriate directory ,. HTC stands for HTML components. The file is a 1x1 pixel transparent GIF image in CSS. If this file is missing, the PNG Image inserted by the label is displayed as a Red Cross-stick.
    2. In iepngfix.htc, modify the path of blank.gif. var blankimg uses the correct path of 'blank.gif ', which is the only configuration to be modified.
    3. In CSS, You need to associate the transparent PNG element with the. HTC file. Example: * {behavior: URL (iepngfix. HTC )}

In the preceding three steps, IE6 supports transparent PNG images.

I thought it would be a good thing, and later I found that not only that is the case!

During our testing process, the local environment is ready for handling; it can be tested on the testing machine.

However, when it finally arrived at the production machine, it suddenly found that it could not work! In IE6, the blue background is displayed.

I found the cause for half a day. After comparative analysis, I found thatCodeIt is the same as that on the test machine, but the problem still exists. What should I do?

Later, I directly searched for the iepngfix. HTC website and found that I did not provide any specific server environment requirements. The problem cannot be solved !!!

In addition, the demo file is uploaded to the testing machine and production machine, and the original problem is found on the production machine. No problem is displayed on the test machine, and the production machine does not work.

This eliminatesProgramProblems.

Later, I finally found another solution, that is, to replace the previous PNG image format, the previous one is png24, and now all are replaced with png8, in this way, IE6 can be identified and the background is transparent!

Therefore, the summary is:

To make the PNG Image background transparent:

The safest way is to convert the format to png8;

If iepngfix. HTC is okay on the server, iepngfix. HTC is also a good choice!

In addition, to convert png24 to png8, the method is also very simple. You can use Photoshop to convert it.

The specific method for converting png24 to png8 is:File-storage for Web and device formats-In presets, select PNG-8 and transparency and save.

 

 

 

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.