百分百源码网-让建站变得如此简单! 登录 注册 签到领金币!

主页 | 如何升级VIP | TAG标签

当前位置: 主页>网站教程>CSS教程> CSS hack在IE6,IE7,firefox用法与区分(1/2)
分享文章到:

CSS hack在IE6,IE7,firefox用法与区分(1/2)

发布时间:01/15 来源: 浏览: 关键词:

 

一、CSS HACK
 以下两种方法几乎能解决现今所有HACK.

 1, !important

 随着IE7对!important的支持, !important 方法现在只针对IE6的HACK.(注意写法.记得该声明位置需要提前.)

 <style>
 #wrapper
 {
 width: 100px!important; /* IE7+FF */
 width: 80px; /* IE6 */
 }
 </style>

 


 2, IE6/IE77对FireFox

 *+html 与 *html 是IE特有的标签, firefox 暂不支持.而*+html 又为 IE7特有标签.

 <style>
 #wrapper
 {
 #wrapper { width: 120px; } /* FireFox */
 *html #wrapper { width: 80px;} /* ie6 fixed */
 *+html #wrapper { width: 60px;} /* ie7 fixed, 注意顺序 */
 }
 </style>


 
 
 ]CSS hack:区分IE6,IE7,firefox
 区别不同浏览器,CSS hack写法:

区别IE6与FF:background:orange;*background:blue;
区别IE6与IE7:background:green !important;background:blue;
区别IE7与FF:background:orange; *background:green;
区别FF,IE7,IE6:background:orange;*background:green !important;*background:blue;
注:IE都能识别*;标准浏览器(如FF)不能识别*;IE6能识别*,但不能识别 !important,IE7能识别*,也能识别!important;FF不能识别*,但能识别!important;
              IE6 IE7 FF
*             √ √ ×
!important × √ √

 

首页 1 2 末页
打赏

打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

百分百源码网 建议打赏1~10元,土豪随意,感谢您的阅读!

共有16人阅读,期待你的评论!发表评论
昵称: 网址: 验证码: 点击我更换图片
最新评论

本文标签

广告赞助

能出一分力是一分吧!

订阅获得更多模板

本文标签

广告赞助

订阅获得更多模板