css兼容

2017-05-24  本文已影响0人  李永州的FE

这样的工具有:html5shiv.js、respond.js、CSS Reset、Normalize.css、Modernizr、Post CSS等;另外,还可以考虑使用条件注释、CSS Hack、JS能力检测等对兼容做一些修补。

经常问到两个名词:

列举5种以上浏览器兼容的写法


<script>alert(1);</script>

.box{
color: red; _color: blue; /ie6/
color: pink; /ie67/
color: yellow\9; /
ie/edge 6-8*/
}

webkit- ,针对safari,chrome浏览器的内核CSS写法
-moz-,针对firefox浏览器的内核CSS写法
-ms-,针对ie内核的CSS写法

*html *前缀只对IE6生效
*+html *+前缀只对IE7生效
@media screen\9{...}只对IE6/7生效
@media \0screen {body { background: red; }}只对IE8有效
@media \0screen,screen\9{body { background: blue; }}只对IE6/7/8有效
@media screen\0 {body { background: green; }} 只对IE8/9/10有效
@media screen and (min-width:0\0) {body { background: gray; }} 只对IE9/10有效
@media screen and (-ms-high-contrast: active),
(-ms-high-contrast: none) {body { background: orange; }} 只对IE10有效等等

以下工具/名词是做什么的(过)

一般在哪个网站查询属性兼容性?

brwoserhack
canIuse

上一篇 下一篇

猜你喜欢

热点阅读