浏览器兼容

2017-03-28  本文已影响20人  shawnzx

CSS Hack

谈一谈浏览器兼容的思路

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

<!--[if IE 6]>
   <p>You are using Internet Explorer 6.</p>
   <![endif]-->
   <!--[if !IE]><!-->
   <script>alert(1);</script>
   <!--<![endif]-->
   <!--[if IE 8]>
   <link href="ie8only.css" rel="stylesheet">
   <![endif]-->
.box{
    color: red;
    _color: blue;              /*ie6能识别*/
    *color: pink;              /*ie67都能识别*/
    color: yellow\9;           /*ie/edge 6-8都能识别*/
}

以下工具/名称是做什么的

<!--[if IE]>用于 IE <![endif]-->
<!--[if IE 6]>用于 IE6 <![endif]-->
<!--[if IE 7]>用于 IE7 <![endif]-->
<!--[if IE 8]>用于 IE8 <![endif]-->
<!--[if IE 9]>用于 IE9 <![endif]-->
<!--[if gt IE 6]> 用于 IE6 以上版本<![endif]-->
<!--[if lte IE 7]> 用于 IE7或更低版本 <![endif]-->
<!--[if gte IE 8]>用于 IE8 或更高版本 <![endif]-->
<!--[if lt IE 9]>用于 IE9 以下版本<![endif]-->
<!--[if !IE]> -->用于非 IE <!-- <![endif]-->

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

上一篇 下一篇

猜你喜欢

热点阅读