IE6、IE7、Firefox之间的兼…
来源:互联网 发布:美拍视频怎么上传淘宝 编辑:程序博客网 时间:2024/04/30 09:07
原文地址:IE6、IE7、Firefox之间的兼容写法作者:深海区的秋天
hack书写规范
因为不同浏览器对W3C标准的支持不一样,各个浏览器对于页面的解释呈视也不尽相同,比如IE在很多情况下就与FF存在3px的差距,对于这些差异性,就需要利用css的hack来进行调整,当然在没有必要的情况下,最好不要写hack来进行调整,避免因为hack而导致页面出现问题。
1、 IE6、IE7、Firefox之间的兼容写法:
写法一:
IE都能识别*;标准浏览器(如FF)不能识别*;
IE6能识别*,但不能识别 !important,
IE7能识别*,也能识别!important;
FF不能识别*,但能识别!important;
根据上述表达,同一类/ID下的CSS hack可写为:
.searchInput {
background-color:#333;
*background-color:#666 !important;
*background-color:#999;
}
一般三者的书写顺序为:FF、IE7、IE6.
写法二:
IE6可识别“_”,而IE7及FF皆不能识别,所以当只针对IE6与IE7及FF之间的区别时,可这样书写:
.searchInput {
background-color:#333;
_background-color:#666;
}
写法三:
*+html 与 *html 是IE特有的标签, Firefox 暂不支持。
.searchInput {background-color:#333;}
*html .searchInput {background-color:#666;}
*+html .searchInput {background-color:#555;}
屏蔽IE浏览器:
select是选择符,根据情况更换。第二句是MAC上safari浏览器独有的。
*:lang(zh) select {font:12px !important;}
select:empty {font:12px !important;}
IE6可识别:
这里主要是通过CSS注释分开一个属性与值,注释在冒号前。
select { display :none;}
IE的if条件hack写法:
所有的IE可识别:
<!–[if IE]> Only IE<![end if]–>
只有IE5.0可以识别:
<!–[if IE 5.0]> Only IE 5.0<![end if]–>
IE5.0包换IE5.5都可以识别:
<!–[if gt IE 5.0]> Only IE 5.0+<![end if]–>
仅IE6可识别:
<!–[if lt IE 6]> Only IE 6-<![end if]–>
IE6以及IE6以下的IE5.x都可识别:
<!–[if gte IE 6]> Only IE 6/+<![end if]–>
仅IE7可识别:
<!–[if lte IE 7]> Only IE 7/-<![end if]–>
因为不同浏览器对W3C标准的支持不一样,各个浏览器对于页面的解释呈视也不尽相同,比如IE在很多情况下就与FF存在3px的差距,对于这些差异性,就需要利用css的hack来进行调整,当然在没有必要的情况下,最好不要写hack来进行调整,避免因为hack而导致页面出现问题。
1、 IE6、IE7、Firefox之间的兼容写法:
写法一:
IE都能识别*;标准浏览器(如FF)不能识别*;
IE6能识别*,但不能识别 !important,
IE7能识别*,也能识别!important;
FF不能识别*,但能识别!important;
根据上述表达,同一类/ID下的CSS hack可写为:
.searchInput {
background-color:#333;
*background-color:#666 !important;
*background-color:#999;
}
一般三者的书写顺序为:FF、IE7、IE6.
写法二:
IE6可识别“_”,而IE7及FF皆不能识别,所以当只针对IE6与IE7及FF之间的区别时,可这样书写:
.searchInput {
background-color:#333;
_background-color:#666;
}
写法三:
*+html 与 *html 是IE特有的标签, Firefox 暂不支持。
.searchInput {background-color:#333;}
*html .searchInput {background-color:#666;}
*+html .searchInput {background-color:#555;}
屏蔽IE浏览器:
select是选择符,根据情况更换。第二句是MAC上safari浏览器独有的。
*:lang(zh) select {font:12px !important;}
select:empty {font:12px !important;}
IE6可识别:
这里主要是通过CSS注释分开一个属性与值,注释在冒号前。
select { display :none;}
IE的if条件hack写法:
所有的IE可识别:
<!–[if IE]> Only IE<![end if]–>
只有IE5.0可以识别:
<!–[if IE 5.0]> Only IE 5.0<![end if]–>
IE5.0包换IE5.5都可以识别:
<!–[if gt IE 5.0]> Only IE 5.0+<![end if]–>
仅IE6可识别:
<!–[if lt IE 6]> Only IE 6-<![end if]–>
IE6以及IE6以下的IE5.x都可识别:
<!–[if gte IE 6]> Only IE 6/+<![end if]–>
仅IE7可识别:
<!–[if lte IE 7]> Only IE 7/-<![end if]–>
0 0
- IE6、IE7、Firefox之间的兼…
- IE6、IE7、Firefox之间的兼容写法:
- 兼容IE6 IE7 Firefox的CSS
- IE6 IE7 Firefox 的CSS hack区分
- 针对firefox ie6 ie7的css样式
- 针对firefox ie6 ie7的css样式
- IE6 IE7 Firefox 的CSS hack
- 兼容Ie6,Ie7,Firefox的办法
- IE6/IE7 /IE8/Firefox/Chrome/Safa…
- IE6/IE7 /IE8/Firefox/Chrom…
- ie7/firefox/ie6 hack
- IE6、IE7、IE8之间的js
- CSShack:区分IE6,IE7,firefox
- IE6, IE7, IE8, Firefox兼容问题
- CSS兼容IE6,IE7,FireFox
- CSS兼容IE6,IE7,FireFox
- IE6、 IE7、IE8、Firefox兼容性问题
- IE6、IE7、IE8、Firefox兼容性问题
- 轻量级文本编辑工具notepad++使用介绍
- 最小生成树kruskal算法
- 快速幂算法C语言版(超详细)
- 服务器上的 Git - 在服务器上部署 Git
- CSS实现兼容性的渐变背景(gr…
- IE6、IE7、Firefox之间的兼…
- CSS实现兼容性的渐变背景(gr…
- android:singleLine="true" 是什么意思?
- 润肤日过输入负好高色而非
- XQuery内置函数
- 验证身份证有效性:
- 正则表达式 // 和##和~~
- LeetCode:Container With Most Water
- 找回密码,使用邮件发送方式