针对IE6,IE7,IE8,IE9,firefox的CSS hack经验分享
2013-03-05 11:18
169 查看
1区别IE6与其它浏览器:
background:orange;
_background:blue;
2区别IE6与IE7:
background:green !important;
background:blue;
3区别IE6、IE7与FF:
background:orange;
*background:green;
4区别FF,IE7,IE6:
background:orange;
*background:green !important;
*background:blue;
5区别IE与非IE浏览器
background:orange;
background:green\9;/*所有IE浏览器都识别(IE6、IE7、IE8、IE9)*/
注:IE6/7能识别*;标准浏览器(如FF)不能识别*;
background-color:orange\0; /*识别ie 8/9*/
background-color:orange\9\0; /*识别ie 9*/
6 *+html 与 *html 是IE特有的标签, 而*+html 又为 IE7特有标签.
#comments{ width: 120px; } /* FireFox */
*html #comments{ width: 80px;} /* ie6 fixed */
*+html #comments{ width: 60px;} /* ie7 fixed */
注意: *+html 对IE7的HACK 必须保证HTML顶部有如下声明:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
总结 :(注:不管是什么方法,书写的顺序都是firefox的写在前面,IE7的写在中间,IE6的写在最后面)
FF不能识别*,但能识别!important;
IE7能识别*,也能识别!important;
IE6能识别*,但不能识别 !important; IE6支持下划线,IE7和firefox均不支持下划线
background:orange;
_background:blue;
2区别IE6与IE7:
background:green !important;
background:blue;
3区别IE6、IE7与FF:
background:orange;
*background:green;
4区别FF,IE7,IE6:
background:orange;
*background:green !important;
*background:blue;
5区别IE与非IE浏览器
background:orange;
background:green\9;/*所有IE浏览器都识别(IE6、IE7、IE8、IE9)*/
注:IE6/7能识别*;标准浏览器(如FF)不能识别*;
background-color:orange\0; /*识别ie 8/9*/
background-color:orange\9\0; /*识别ie 9*/
6 *+html 与 *html 是IE特有的标签, 而*+html 又为 IE7特有标签.
#comments{ width: 120px; } /* FireFox */
*html #comments{ width: 80px;} /* ie6 fixed */
*+html #comments{ width: 60px;} /* ie7 fixed */
注意: *+html 对IE7的HACK 必须保证HTML顶部有如下声明:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
总结 :(注:不管是什么方法,书写的顺序都是firefox的写在前面,IE7的写在中间,IE6的写在最后面)
FF不能识别*,但能识别!important;
IE7能识别*,也能识别!important;
IE6能识别*,但不能识别 !important; IE6支持下划线,IE7和firefox均不支持下划线
相关文章推荐
- CSS hack:针对IE6,IE7,IE8,IE9,firefox显示不同效果
- IE等主流浏览器css hack,包括IE6,IE7,IE8,IE9,firefox,chrome
- CSS hack:区分IE6,IE7,IE8,IE9,firefox
- IE等主流浏览器css hack,包括IE6,IE7,IE8,IE9,firefox,chrome
- css_针对IE6,IE7,IE8,IE9,firefox显示不同效果
- CSS Hack解决两个阵营:①IE8、IE9②IE6、IE7、FireFox
- CSS hack:针对IE6,IE7,firefox显示不同效果
- 浏览器HTTP_USER_AGENT汇总——Firefox、Chrome、IE9、IE8、IE7、IE6
- div+css 兼容ie6 ie7 ie8 ie9和FireFox Chrome等浏览器方法
- CSS hack:针对IE6,IE7,firefox显示不同效果
- IE6、 IE7、IE8、IE9、Firefox兼容性问题
- DIV+CSS--IE6,IE7,IE8,Firefox IE8 css hack对照表
- CSS hack:针对IE6,IE7,firefox显示不同效果
- 解决jQuery uploadify3.2 IE6 IE7 或者 firefox下不显示,chrome IE8 IE9却正常
- CSS HACK区别IE6、IE7、IE8、Firefox兼容性
- CSS Hack(Safari、Opera、Chrome、IE6、IE7、 IE8和IE9)
- div+css 兼容ie6 ie7 ie8 ie9和FireFox Chrome等浏览器方法
- (十年积累)div+css 完全兼容ie6 ie7 IE8 IE9 和firefox方法
- 【转】CSS兼容性问题 CSS hack:区分IE6,IE7,IE8,Firefox
- CSS hack 针对IE6,IE7,firefox显示不同效果