Home  >  Article  >  Web Front-end  >  I urgently need an expert to solve the problem of transparency of png background images in CSS in IE6! _html/css_WEB-ITnose

I urgently need an expert to solve the problem of transparency of png background images in CSS in IE6! _html/css_WEB-ITnose

WBOY
WBOYOriginal
2016-06-24 12:17:471033browse

Urgently asking experts to solve the problem of transparency of png background images in CSS in IE6!
Why is it possible to use filters for css in Dreamweaver, but not in eclipse projects? The path in src is also correct, but the image either cannot be displayed or there is no transparency effect? ? ? ? ? ? ? ?
.bg2{filter: progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=scale, src="logo.png"); width:100px; height:100px;} 


Reply to discussion (solution)

There are 3 solutions in the resources. You can go to my resources to download.

There are 3 solutions in the resources. You can go to my resources to download.

I downloaded it and tried all three methods, but it still doesn’t work?

If there is no translucent part, use a gif format image

Quoting the reply from stongyann on the 1st floor: There are 3 solutions in the resources. You can go to my resources to download.

I downloaded it and tried all three methods, but it still doesn’t work?

Pay attention to Lu Jin. In css, one of the paths is the normal path and the other is the path relative to the page and the image.

DD_belatedPNG_0.0.8a Try this JS, I have been using

You can save the image in png8 format, alpha is transparent

PNG images are used in the page, quoted below js file

var arVersion = navigator.appVersion.split("MSIE")var version = parseFloat(arVersion[1])function fixPNG(myImage) {    if ((version >= 5.5) && (version < 7) && (document.body.filters))     {       var imgID = (myImage.id) ? "id='" + myImage.id + "' " : ""    var imgClass = (myImage.className) ? "class='" + myImage.className + "' " : ""    var imgTitle = (myImage.title) ?                "title='" + myImage.title  + "' " : "title='" + myImage.alt + "' "    var imgStyle = "display:inline-block;" + myImage.style.cssText    var strNewHTML = "<span " + imgID + imgClass + imgTitle                  + " style=\"" + "width:" + myImage.width                   + "px; height:" + myImage.height                   + "px;" + imgStyle + ";"                  + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"                  + "(src=\'" + myImage.src + "\', sizingMethod='scale');\"></span>"    myImage.outerHTML = strNewHTML       }}

CSS setting transparency:
	filter:alpha(opacity=50);	-moz-opacity: .5;	opacity: .5;

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn