IE6 background transparency setting method IE6 background color transparency and PNG Image transparency Solution

Source: Internet
Author: User

Internet Explorer 6 makes us love and hate it. What we love it is that it makes the code we write more standard. What we hate is that it has too many headers.IE6 Common Bugs(Click here for details. Now, Baidu browser is used to investigate that the domestic market share is less than 6%, but we are afraid of encountering websites that need to be compatible with Internet Explorer 6.

Among them, a common problem with IE6 is the transparent background of IE6. Transparent background is mainly divided into transparent background color and background image or PNG image.

I. IE6 background color transparency

Generally, the following is a clear background for a browser:
Opacity: 0.5;
-Moz-opacity: 0.5;
-WebKit-opacity: 0.5;
-Khtml-opacity: 0.5;
 
-Moz-is Firefox prefix-WebKit-Is Google and Apple browser prefix-kthml-for Linux desktop browser

IE6 transparent backgroundFilter is required:Filter: alpha (opacity = 50 );It's okay to use genuine IE6 for testing. Sometimes ietester is not easy to use. We also know that ietester is not so complete.

IE8 is also special:-MS-filter: "progid: DXImageTransform. Microsoft. Alpha (opacity = 50 )";

In this way, the problem of transparent background of all browsers is fixed.

Ii. Questions about transparent background of PNG images in IE6

First, IE6 does not support PNG Image transparency. IE6 supports png8 image transparency, but does not support png24 and png32 image transparency. Therefore, we recommend that you use the png8 format if you want to consider IE6 when making images transparently. You can select the exported PNG version for both PS and firework.

We also know that the png8 color is not as rich as the png24 color. Sometimes, you must use the png24 color. Therefore, Mr. Xiaoqiang has prepared a JS file for everyone. This JS file specifically solves the transparent problem of IE6 PNG 24. It makes the PNG images on the entire page transparent, without the need to solve the problem one by one, which is effort-saving and easy to use. The usage is as follows:

Step 1: Merge the following code into the page. Pay attention to path issues!

<SCRIPT src = "iepng. js" type = "text/JavaScript"> </SCRIPT>

<SCRIPT type = "text/JavaScript">
Evpng. Fix ('div, UL, IMG, Li, input, span, B, H1, H2, H3, H4, ');
</SCRIPT>

The red part is the selector, and most of them are included. In fact, it is not replaced.

Step 2: Put the following JS files into our site. So far, it has been easier to deal with the problem of transparent ie6png images.

The above is shared by Mr. Xiaoqiang and I hope it will help you.

Xiaoqianxiao: share your knowledge with you.

Download JS files: click here

IE6 background transparency setting method IE6 background color transparency and PNG Image transparency Solution

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.