Ie6 PNG transparency Fix / Hack

As IE6 doesn’t support Alpha Channel Transparency PNG files. With this code we can use PNG’s In IE 6.
Just Copy and paste this code in this CSS file. Copy transparent.gif in to “images” folder.

/*Start css code*/

* html img,
* html .png
{position:relative; behavior: expression((this.runtimeStyle.behavior=”none”)&&(this.pngSet?this.pngSet=true:(this.nodeName == “IMG” && this.src.toLowerCase().indexOf(’.png’)>-1?(this.runtimeStyle.backgroundImage = “none”,this.runtimeStyle.filter = “progid:DXImageTransform.Microsoft.AlphaImageLoader(src=’” + this.src + “‘, sizingMethod=’image’)”, this.src = “images/transparent.gif”):(this.origBg = this.origBg? this.origBg :this.currentStyle.backgroundImage.toString().replace(’url(”‘,”).replace(’”)’,”),
this.runtimeStyle.filter = “progid:DXImageTransform.Microsoft.AlphaImageLoader
(src=’” + this.origBg + “‘, sizingMethod=’crop’)”,this.runtimeStyle.backgroundImage = “none”)),this.pngSet=true));}

/*End css code*/

Speak Your Mind

Tell us what you're thinking...
and oh, if you want a pic to show with your comment, go get a gravatar!

You must be logged in to post a comment.