Six simple solutions for transparency issues in Internet Explorer

Source: Internet
Author: User

In Internet ExplorerTransparency is always a big problem for all web designers. IE6 compatibility issues to be considered during Webpage Design., The website we designed should be debugged in Firefox/Opera/chrome, and finally tested for compatibility issues in IE.

A major issue about IE6 is transparency.. IE6 cannot be correctly rendered transparentPNG image. The result is that the website you designed can be displayed in other browsers and put under IE6. Haha,Fortunately, there are several solutions that can help web designers overcome IE6 transparency issues. Each of them uses a different method. Today, I will give you a brief look at these methods. You can see which method you are considering. If you encounter similar problems in the future, don't talk about Baidu search and how to solve it, as long as youArticleNote that any transparency issues will be solved in the future.

1. Jquery.png fix. js

This solution requires jquery and CSS backgrounds to work together.To use this method, simply add the jquery plug-in your header and pngfix, and then activate the JS function.This plug-in will fix the PNG transparency problem that is missing in Windows Internet Explorer 5.5 and 6. How to use it

 

1. Reference a file in the header

 1  <  Head  >  
2 ...
3 < Script Type = "Text/JavaScript" SRC = "Jquery-latest.pack.js" > </ Script >
4 < Script Type = "Text/JavaScript" SRC = "Jquery.png fix. js" > </ Script >
5 ...
6 </ Head >

2. Activate this method.

 1   <  Head >  
2 ...
3 < Script Type = "Text/JavaScript" >
4 $ (Document). Ready ( Function (){
5 Optional (document).png fix ();
6 });
7 </ Script >
8 ...
9 </ Head >

 

2. Dd_belatedpng

Dd_belatedpng youe IE6/PNG is another JavaScript solution.To use this solution, you only need to add it to your document and call the dd_belatedpng.fix togother attribute of the CSS selector..

 
1 <! --[If IE 6]>
2 <SCRIPT src = "dd_belatedpng.js"> </SCRIPT>
3 <SCRIPT>
4 /* Example */
5 Dd_belatedpng.fix('.png _ BG ');/* the string parameter can be any CSS selector *//*. The example of png_bg is unnecessary * // * change it to suit you! */</SCRIPT> <[endif]->
6

3.Twinhelix ie png fix
The twinhelix solution requires the use of CSS attributes.You just need to upload the iepngfix.htc?and languak.gif files in the file package.

4. Ie7.js

Ie7.js is a javascript library. Microsoft Internet Explorer acts like a standard browser.It fixes many HTML and CSS problems, and the transparent PNG in ie5 and IE6 works normally.

In IE7CodeYes

1 <! --[If lt IE 7]>
2 <SCRIPT src = "http://ie7-js.googlecode.com/svn/version/2.1 (beta4)/ie7.js"> </SCRIPT>
3 <! [Endif]-->

The code in IE8 is

 
<! --[If lt IE 8]>
<SCRIPT src = "http://ie7-js.googlecode.com/svn/version/2.1 (beta4)/ie8.js"> </SCRIPT>
<! [Endif]-->

The code in ie9 is

<! --[If lt ie 9]>
<SCRIPT src = "http://ie7-js.googlecode.com/svn/version/2.1 (beta4)/ie9.js"> </SCRIPT>
<! [Endif]-->

5. Unit PNG fix

Unitpng PatchingProgramWrite the code and run it automatically to ensure that all PNG files are transparent and are not duplicated with the background.

6, PNG in Windows IE

With only three lines of code, you will get the transparency of all your PNG files.Package and download code

 
<! --[If lt IE 7.]>
<SCRIPT defer type = "text/JavaScript" src = "pngfix. js"> </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.