IE6下的PNG图片透明问题解决(a:hover)
不怕大家笑话,今天一下午竟鼓捣IE6下半透明图片的问题了。
简单方法是有,用滤镜,但我在Firefox下不能正常浏览,况且又耗资源,还不是WEB标准所提倡的,所以,弃之。
filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='images/1.png', sizingMethod='crop');
之后开始网上搜资料,试了3,4个,不是把自己页面撑破了的(可能自己哪些地方写的不好),就是鼠标划过效果的png图片不能透明,反正是疲了点儿。
最后,找到个适合我的。贴出来给需要的人分享下,相当的简单...
小说明下:这里是设置你所需要透明图片容器的名字,包括 a:hover (别写错了 :D)
<script type="text/javascript">
DD_belatedPNG.fix('.png_img, .img_box a:hover');
</script>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<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>
</html>
先写下着一种吧,剩下没用的几种有空了再发布 :D
打包下载:http://dl.dbank.com/c08akfo1bu 或 115
推荐.NET配套的通用数据层ORM框架:CYQ.Data 通用数据层框架