Posted By

DeadLy on 01/18/08


Versions (?)

Who likes this?

5 people have marked this snippet as a favorite


IE PNG FIX. CSS Solution

 / Published in: CSS

  1. * html img,
  2. * html .png{
  3. azimuth: expression(
  4.   this.pngSet?this.pngSet=true:(this.nodeName == "IMG" && this.src.toLowerCase().indexOf('.png')>-1?(this.runtimeStyle.backgroundImage = "none",
  5. this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.src + "', sizingMethod='image')",
  6. this.src = "/images/transparent.gif"):(this.origBg = this.origBg? this.origBg :this.currentStyle.backgroundImage.toString().replace('url("','').replace('")',''),
  7. this.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + this.origBg + "', sizingMethod='crop')",
  8. this.runtimeStyle.backgroundImage = "none")),this.pngSet=true
  10. );
  11. }

Report this snippet  


RSS Icon Subscribe to comments
Posted By: SmpleJohn on January 18, 2008

Um... look under the Most Popular links on the home page. There is already a solution for this. Is there a reason this one is better, or is it just a different way to do the same thing?

Just curious:)

Posted By: mikaelhultkvist on February 13, 2008

Nice snipple! But I cant get it to work with background images. Anyone else got this problem. Its supposed to work om backgrounds to right?

Posted By: LadynRed on March 3, 2008

The transparency PNG 'fix' does NOT work for repeating images so unless it's a 1-image static background it won't work.

You need to login to post a comment.