解决IE6下CSS兼容性的两把神器

神器一、csshover.htc

解决IE6不支持非a标签的hover伪类。

引入方式:在样式表中引入

例:
body { _behavior: url(csshover.htc); }

应用:

class="out"

用CSS控制页面特效
.out{ width:200px; height:200px; border:1px solid #CCC; }
.out:hover .in{ display:block; }
.out .in{ width:100px; height:100px; margin:50px auto; background:#0F3; display:none; }

 

神器二、DD_belatedPNG_0.0.8a-min.js

解决IE6下不支持png-24和png-32做背景图片不支持透明

引用方式:

<!--[if IE 6]>
<script type="text/javascript" src="DD_belatedPNG_0.0.8a-min.js"></script>
<script >DD_belatedPNG.fix('*');</script>
<![endif]-->

实例:

div
style="width:500px; height:100px; padding-left:100px; background:url(png-32-ps.png); background-repeat:no-repeat; background-position:-20px -20px;"
背景图片:

 

补充1:用滤镜解决不支持背景定位属性background-position ,实例参考我的另一篇博客网页中的gif与png

补充2:下载地址:http://pan.baidu.com/share/link?shareid=175658&uk=3858966269

posted @ 2012-12-27 11:09  龙则  阅读(181)  评论(0编辑  收藏  举报