PNG transparentes en IE con CSS
Bueno, dicho lo malo que es Internet Explorer, esta es una solución para todos los que le han recordado su mamá a los desarrolladores del IE 6 por no soportar la transparencia en archivos PNG (el IE7 ya tiene ese soporte). Este truco es aplicable a las imágenes que se cargan a través de una hoja de estilos (CSS). Sólo necesitan agregar éste código a su hoja de estilos:
* html img,
* html .png{
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 = “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)
);
}
Por supuesto que esto no es un código válido, pero si funciona
y no es tan lento, así que lo pueden usar para todas las imágenes de su sitio.
Enlace | CSS Png Fix for IE
Visto en webAdictos








Mayo 20, 2008 a las 3:59 am
este codigo a mi no me funciona, lo he pegado tal cual y no hace absolutamente nada, no se si hay que quitarle algo al codigo, ya sea comillas o lo que sea