Transparent Image Processing
<! -- [If lt IE 7]>
<Style type = "text/CSS">
Div, IMG {behavior: URL (iepngfix. HTC )}
</Style>
<! [Endif] -->
<Style>
Body {Background: URL (/bg.jpg )}
. Iepng {width: 275px; Height: 94px; Background: URL (/home.png); padding: 20px ;}
</Style>
<Body>
<Div class = "iepng"> test <br/>
<Br/>
<A href = "#"> transparent images </a> </div>
</Body>
Now, test IE6 and you will find that the PNG background is transparent. However, sometimes we need to implement this effect on the located layer. For example, if the effect of this example is fixed on another layer, similar to the pop-up window, we need to use position: absolute; float this layer. Then the problem occurs again, and the link becomes invalid ???
<! -- [If lt IE 7]>
<Style type = "text/CSS">
Div, IMG {behavior: URL (iepngfix. HTC )}
</Style>
<! [Endif] -->
<Style>
Body {Background: URL (/bg.jpg )}
. Iepng {position: absolute; top: 261px; left: 309px; width: 275px; Height: 94px; Background: URL (/home.png); padding: 20px ;}
</Style>
<Body>
<Div class = "iepng"> test <br/>
<Br/>
<A href = "#"> test text </a> </div>
</Body>
Previously, I also saw the method provided by others. I defined a relative property position: relative; for the link, but I tried it. Is there any other way to achieve this? Below I will provide a stupid way to achieve it:
Since it is a floating layer with an absolute position, we use two floating layers with an absolute position to separately set the background on a layer and place this layer down, is this method feasible to put text and link content on the top layer ?? Practice is the only criterion for testing truth. Let's wait and see !!
<! -- [If lt IE 7]>
<Style type = "text/CSS">
Div, IMG {behavior: URL (iepngfix. HTC )}
</Style>
<! [Endif] -->
<Style>
Body {Background: URL (/bg.jpg )}
. Iepng {position: absolute; top: 261px; left: 309px; width: 315px; Height: 134px; Background: URL (/home.png); Z-index: 1 ;}
. Iepng1 {position: absolute; top: 261px; left: 309px; width: 275px; Height: 94px; padding: 20px; Z-index: 2 ;}
</Style>
<Body>
<Div class = "iepng1"> test <br/>
<Br/>
<A href = "#"> test text </a> </div>
<Div class = "iepng"> </div>
</Body>
Haha, the problem is solved! Use Background: URL (/home.png )! Important; Background: none; filterrogidximagetransform. microsoft. alphaimageloader (Enabled = "true", sizingmethod = "image", src = "/home.png") to make the background transparent, when using position: absolute; link failure can also be solved through double-layer overlap during locating.
Source http://www.aa25.cn/368.shtml