IE6 IE7 FifeFox下CSS的hack写法

区别IE6/IE7/FifeFox的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和firefox均不支持下划线。

  所以一般的书写顺序就是最新至最低版本:先火狐,然后IE7,最后是IE6。

-------------------CSS布局小技巧--------------------

  鼠标点击输入框预置字段消失:<input type="text" value="输入关键词..." name="username" id="username" onfocus="if (this.value == '输入关键词...') {this.value = '';}" onblur="if (this.value == '') {this.value = '输入关键词...';}" size="12" />。

  新闻列表居左时间居右效果:<li><span style=“text-algin;right;float;right;”>时间输出</span>新闻列表</li>,其中时间字段在前,放在后面的话会依次递降一行。

  图片相框效果:img{padding:7px;border:1px solid #ccc;background-color: #FFF;filter:progid:DXImageTransform.Microsoft.Glow(color=#cccccc,Strength=5);}



[dudumao 于 2011-02-11 03:57 AM 更新]
上一篇: 常用图片尺寸大小
下一篇: 关于使用手机飞信
文章来自: 本站原创
引用通告: 查看所有引用 | 我要引用此文章
Tags: CSS
相关日志:
评论: 0 | 引用: 0 | 查看次数: 5743
发表评论
你没有权限发表评论!