IE6 background transparent setting method IE6 background color transparent and PNG image transparent resolution

Source: Internet
Author: User

IE6 Browser, let us love and hate. Love It is, can let us write code when, can be more standard, hate is, it has too many unreasonable IE6 common bug, let us burn. Now with the Baidu Browser survey, the domestic share less than 6%, but, it is afraid to meet the need to tune compatible IE6 website.

Among them, a IE6 common problem is IE6 transparent background issue. Transparent background mainly sub-background color transparency and background picture or PNG picture transparency problem.

First, IE6 background color transparent

General browser, give a box transparent background notation is:
opacity:0.5;
-moz-opacity:0.5;
-webkit-opacity:0.5;
-khtml-opacity:0.5;

Where-moz-is the Firefox prefix-webkit-is google and Apple browser prefix-kthml-for Linux desktop system Browser

IE6 Background Transparency requires the aid of a filter: filter:alpha (OPACITY=50); to use genuine IE6 Test no problem ha, sometimes ietester bad use, we also know that IETester is not so complete.

IE8 is also more special:-ms-filter: "Progid:DXImageTransform.Microsoft.Alpha (opacity=50)";

That's pretty much the problem with all the browser's transparent backgrounds.

Second, IE6 about the PNG picture background transparency problem

First of all, IE6 is not unsupported PNG image transparency, IE6 is supported PNG8 picture transparent, but does not support PNG24 and PNG32 image transparency. Therefore, we need to make the image transparent, if you want to consider IE6, it is best to use the PNG8 format. Both PS and firework can choose the exported PNG version.

We also know that Png8 color is not png24 so rich, sometimes, it must be used png24, therefore, Mr. Xiao Qiang to everyone prepared a JS file, this JS specifically to solve the IE6 PNG 24 transparency problem. It can make the whole page of PNG image transparent, do not need a picture of the solution, very labor-saving, and the use is very simple. Use the following:

The first step is to copy the following code into the page. Notice the problem with the path Oh!

<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,a ');
</script>

The red part is the selector, most of it contains, in fact, do not use * to replace.

The second step, the following JS file, put in our site can be. So far, it is better to deal with the ie6png picture transparency problem.

The above is Xiao Qiang teacher to share, hope to everyone help.

Xiao Qiang 00, share knowledge with you.

JS File Download: Please click here

IE6 background transparent setting method IE6 background color transparent and PNG image transparent resolution

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.