[转]CSS hack总结
2011-02-07 13:15
204 查看
经常会用到但是又记不住的!important *星号 和 _下划线
写CSS的时候总是盼望着IE6、IE7时代的早点结束
这个针对不同的浏览器写不同的CSS code的过程,就叫CSS hack。
区别不同浏览器,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均不支持下划线。
于是大家还可以这样来区分IE6,IE7,Firefox
background:orange;*background:green;_background:blue;
注:不管是什么方法,书写的顺序都是firefox的写在前面,IE7的写在中间,IE6的写在最后面。
形象的总结一下Firefox 、IE6、IE7三种浏览器的CSS Hack写法:(其中橙色代表FF、蓝色代表IE6、绿色代表IE7)
区别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;
不管是什么方法,书写的顺序都是Firefox的写在前面,IE7写在中间,IE6写在最后面。
写CSS的时候总是盼望着IE6、IE7时代的早点结束
这个针对不同的浏览器写不同的CSS code的过程,就叫CSS hack。
区别不同浏览器,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均不支持下划线。
于是大家还可以这样来区分IE6,IE7,Firefox
background:orange;*background:green;_background:blue;
注:不管是什么方法,书写的顺序都是firefox的写在前面,IE7的写在中间,IE6的写在最后面。
形象的总结一下Firefox 、IE6、IE7三种浏览器的CSS Hack写法:(其中橙色代表FF、蓝色代表IE6、绿色代表IE7)
区别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;
不管是什么方法,书写的顺序都是Firefox的写在前面,IE7写在中间,IE6写在最后面。
相关文章推荐
- css hack 总结 不断更新
- css hack总结 图片整理版
- IE6/IE7/FF的CSS hack总结
- IE6/IE7/FF的CSS hack总结
- Css hack总结和解决方法
- CSS Hack代码与浏览兼容总结
- Css hack总结及其最佳用法,告诉你怎么运用hack,无懈可击的解决各个浏览器的样式兼容
- css hack 总结
- css hack 总结
- css hack 总结
- IE6/IE7/FF的CSS hack总结
- 史上最全的CSS hack方式一览 jQuery 图片轮播的代码分离 JQuery中的动画 C#中Trim()、TrimStart()、TrimEnd()的用法 marquee 标签的使用详情 js鼠标事件 js添加遮罩层 页面上通过地址栏传值时出现乱码的两种解决方法 ref和out的区别在c#中 总结
- IE6 IE7 FF的CSS Hack总结
- 常用CSS hack 方式总结
- 自己总结中 css hack
- 对ie CSS hack总结和理解
- css hack 学习总结
- IE 6 ~ 9 CSS Hack 写法总结
- css hack小小总结
- 【总结】IE6,IE7,IE8,Firefox兼容的css hack 补充!