使用 png 在 ie6 下透明效果,通过使用css滤镜,实现如下:
_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader (src="http://img07.taobaocdn.com/tps/i7/T1Jl8HXh0RXXXXXXXX-50-50.png ",sizingMethod="noscale");
示例:
<html>
<head>
<style type="text/css">
body{ background:#c30;}
.test{
height:100px;
width:100px;
background:url( http://img07.taobaocdn.com/tps/i7/T1Jl8HXh0RXXXXXXXX-50-50.png ) no-repeat center center;
_background-image:none;
_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" http://img07.taobaocdn.com/tps/i7/T1Jl8HXh0RXXXXXXXX-50-50.png",sizingMethod="noscale ");
}
</style>
</head>
<body>
<div class="test">
</div>
</body>
</html>
<head>
<style type="text/css">
body{ background:#c30;}
.test{
height:100px;
width:100px;
background:url( http://img07.taobaocdn.com/tps/i7/T1Jl8HXh0RXXXXXXXX-50-50.png ) no-repeat center center;
_background-image:none;
_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=" http://img07.taobaocdn.com/tps/i7/T1Jl8HXh0RXXXXXXXX-50-50.png",sizingMethod="noscale ");
}
</style>
</head>
<body>
<div class="test">
</div>
</body>
</html>
2011-1-11 更新:
filter中的图片地址为src="",经过测试,为
http绝对路径地址 ,相对路径无法访问。特此备注~