针对特定浏览器起作用的CSS: IE Chrome Firefox CSS Hack
2014-11-12 16:22
726 查看
Firefox的CSSHack
只在Firefox上应用的CSS Hack,虽然这种情况非常少,但有时也会碰到:@-moz-document url-prefix() { .cssSelector { font-size: 14px; } }
Chrome的CSSHack
只在Chrome上应用的CSS Hack,目前这种情况还没有碰到(使用Chrome作为开发浏览器的原因?),有备无患吧。@media screen and (-webkit-min-device-pixel-ratio:0) { #test1{color:red;} }
IE6/7/8/9+的CSS Hack
只在IE上应用的CSS Hack, 这种情况几乎经常碰到, 这里使用的是一种通用的方法,情况复杂,需要先划分一下版本:在body上附加一个IE版本的class
Hack CSS跟其他CSS文件写一起。
IE9+ 不加Hack;IE6,IE7, IE8 加 ie的前辍, IE6多加一个ie6的前辍Hack (大部分给ie7/8写的hack, IE6都会用到)
<!--[if lt IE 7 ]><body class="ie ie6"><![endif]--> <!--[if IE 7]><body class="ie"><![endif]--> <!--[if IE 8]><body class="ie"><![endif]-->
为IE附加新的CSS文件
IE7/8多加一个,IE6多加两个,就让IE多装点东西吧,不要污染别的CSS文件
<!--[if lt IE 9]> <link type="text/css" rel="stylesheet" href="css/show_ie.css"> <![endif]--> <!--[if lt IE 7]> <link type="text/css" rel="stylesheet" href="css/show_ie6.css"> <![endif]-->
注* lt 是 less than的意思;即 "ifless than IE9" = "if lt IE 9",还有几个,不过用得比较少
gt: greater than
lte: less than or equal to
相关文章推荐
- 针对特定浏览器起作用的CSS: IE Chrome Firefox CSS Hack
- ie chrome firfox css兼容-iecss样式修复-针对特定浏览器引入对应的css
- 各种浏览器的Hack写法(chrome firefox ie等)
- CSS透明度设置支持IE,Chrome,Firefox浏览器
- 各种浏览器的Hack写法(chrome firefox ie等)
- 各种浏览器的Hack写法(chrome firefox ie等)
- 针对主流浏览器的CSS-HACK写法及IE常用条件注释
- CSS透明度设置支持IE,Chrome,Firefox浏览器
- 针对主流浏览器的CSS-HACK写法及IE常用条件注释
- 各种浏览器的Hack写法(chrome firefox ie等)
- 各种浏览器的Hack写法(chrome firefox ie等)
- 针对主流浏览器的CSS-HACK写法及IE常用条件注释
- 各种浏览器的Hack写法(chrome firefox ie等)
- 各种浏览器的Hack写法(chrome firefox ie等)
- 各种浏览器的Hack写法(chrome firefox ie等)
- CSS透明度设置支持IE,Chrome,Firefox浏览器
- 针对主流浏览器的CSS-HACK写法及IE常用条件注释
- 各种浏览器的Hack写法(chrome firefox ie等)
- 针对主流浏览器的CSS-HACK写法及IE常用条件注释