ie7ie8可以用css3的属性吗

html-css017

ie7ie8可以用css3的属性吗,第1张

不可以,IE9才开始兼容CSS3,而且还不是完全兼容,比如border-image属性IE9就不兼容。但是大部分常用的还是兼容的,比如border-radius。但是IE7和8是完全不兼容CSS3

第一种,是CSS HACK的方法

height:20px/*For Firefox*/

*height:25px/*For IE7 &IE6*/

_height:20px/*For IE6*/

注意顺序。

这样也属于CSS HACK,不过没有上面这样简洁。

#example { color: #333} /* Moz */

* html #example { color: #666} /* IE6 */

*+html #example { color: #999} /* IE7 */

第二种是使用IE专用的条件注释

<!--其他浏览器 -->

<link rel="stylesheet" type="text/css" href="css.css" />

<!--[if IE 7]>

<!-- 适合于IE7 -->

<link rel="stylesheet" type="text/css" href="ie7.css" />

<![endif]-->

<!--[if lte IE 6]>

<!-- 适合于IE6及一下 -->

<link rel="stylesheet" type="text/css" href="ie.css" />

<![endif]-->

第三种css filter的办法,以下为经典从国外网站翻译过来的。.

新建一个css样式如下:

#item {

width: 200px

height: 200px

background: red

}

新建一个div,并使用前面定义的css的样式:

<div id="item">some text here</div>

在body表现这里加入lang属性,中文为zh:

<body lang="en">

现在对div元素再定义一个样式:

*:lang(en) #item{

background:green !important

}

兼容性不一样

疼讯跟遨游的内核是跟着IE的内核来的,它们的另一个模式是webkit,也就是跟谷歌的内核一样.

另外,它们的浏览器都加了自己的东西,所以兼容性是难免的.