css兼容
1.css3
选择器
IE9 | IE8 | IE7 | |
---|---|---|---|
:first-child | yes | yes | yes |
:last-child | yes | no | no |
:nth-child(n) | yes | no | no |
:first-last-child(n) | yes | no | no |
2.css3
媒体查询
IE8
不支持媒体查询
解决:respond.js
,在页面中所有css
文件的引用位置之后引用Respond.js
3.rem
不兼容
rem
是相对于根元素<html>
的字体大小比率单位,成了目前主流的单位之一。IE9+
开始支持,IE8
就只能通过引入js
库来支持了
解决:在页面中引用rem.js
文件。需要引用在页脚,也就是<body>
末尾,在所有css
文件引用和DOM
元素之后.
4.placeholder
placeholder
是h5
的属性,ie8
不支持
解决:引入jquery-placeholder
插件