浏览器兼容

2017-10-07  本文已影响0人  曾祥辉

1.什么是 CSS hack

由于不同的浏览器,比如Internet Explorer 6,Internet Explorer 7,Mozilla firefox等,对CSS的解析认识不一样,因此会导致生成的页面效果不一样,得不到我们所需要的页面效果。 这个时候我们就需要针对不同的浏览器去写不同的CSS,让它能够同时兼容不同的浏览器,能在不同的浏览器中也能得到我们想要的页面效果。

2.谈一谈浏览器兼容的思路

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

<!–-[if IE 7]>
<link rel="stylesheet" href="ie7.css" type="text/css" />
<![endif]–->
css:after{
content: " ";
display: block;
clear: both;
}
css{
*zoom: 1;
}
.color1{ color:#F00; color/*\**/:#00F /*\**/}/*IE6,IE7,IE8,FF,OP,SA识别*/
.color2{ color:#F00; color /*\**/:#00F /*\9**/}/*IE7,IE8,FF,OP,SA识别*/
.color3{ color:#F00; color/*\**/:#00F \9}/*IE6,IE7,IE8识别*/
.color4{ color:#F00; color /*\**/:#00F\9}/*IE7,IE8识别*//*“color”和“/*\**/”之间有个空格*/
.element{
  display: inline-block;
  *display: inline;
  *zoom: 1;
}
.all IE{property:value\9;}
.gte IE 8{property:value\0;}
.lte IE 7{*property:value;}
.IE 8/9{property:value\0;}
.IE 9{property:value\9\0;}
.IE 7{+property:value;}
.IE 6{_property:value;}
.not IE{property//:value;}

4.以下工具/名词是做什么的

<!--[if * IE N]--><条件语句><![endif]-->(其中“*”为下列值或为空,N为IE版本号)
lte:就是Less than or equal to的简写,也就是小于或等于的意思。
lt :就是Less than的简写,也就是小于的意思。
gte:就是Greater than or equal to的简写,也就是大于或等于的意思。
gt :就是Greater than的简写,也就是大于的意思。
!  :就是不等于的意思,跟javascript里的不等于判断符相同。

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

caniuse.com

上一篇 下一篇

猜你喜欢

热点阅读