当前位置:编程学习 > JS >>

IE6下的PNG图片透明问题解决方法

ie6下的png图片透明问题解决方法

简单方法是有,用滤镜,但我在firefox下不能正常浏览,况且又耗资源,还不是web标准所提倡的,所以,弃之。

filter:progid:dximagetransform.microsoft.alphaimageloader(src='images/1.png', sizingmethod='crop');

这里是设置你所需要透明图片容器的名字,包括 a:hover (别写错了 :d)

<script type="text/网页特效">
dd_belatedpng.fix('.png_img, .img_box a:hover');
</script>

还有一个js文件,打包下载 或 115  或 oeo.la


<title>ie6 png 半透明</title>
<!--[if ie 6]>
<script type="text/javascript" src="js/dd_belatedpng.js"></script>

<script type="text/javascript">
dd_belatedpng.fix('.png_img, .img_box a:hover');
</script>
<![endif]-->

<style type="text/css教程">
body {
background-color:#000;
}
.img_box {
width:500px;
height:300px;
position:relative;
}
.img_box a {
display:block;
height:150px;
width:150px;
color:#f33;
}
.img_box a:hover {
background:url(images/2.png) left top no-repeat;
}
</style>
</head>

<body>
<img class="png_img" src="images/1.png" alt="" />
<div class="img_box"> <a href="#">超链接透明 a:hover</a> </div>
</body>

 

补充:网页制作,js教程 
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,