好傢伙,我有以下..CSS IE8第一胎和最後孩子
.selected2:first-child{
background: url(../img/css/first-selected.png) no-repeat !important;
background-position: center center !important;
box-shadow: inset 1px 1px 5px 2px rgba(221,221,221,1) !important;
}
.selected2{
background: url(../img/css/second-selected.png) no-repeat !important;
background-position: center center !important;
box-shadow: inset 1px 1px 5px 2px rgba(221,221,221,1) !important;
}
.selected2:last-child{
background: url(../img/css/third-selected.png) no-repeat !important;
background-position: center center !important;
box-shadow: inset 1px 1px 5px 2px rgba(221,221,221,1) !important;
}
它可以完美運行在IE9中,鉻,歌劇,火狐...但在IE8我只得到第二背景在每一個元素上。
什麼問題? ie8不支持第一個孩子?
問題是http://stackoverflow.com/questions/7938521/browser-support-for-css-first-child-and-last-child – 2013-03-22 15:16:55
的更好的答案會給這個網站http:// quirksmode。 org/css/selectors/ – 2013-03-22 15:17:12
http://caniuse.com/#feat=css-sel3 – Michael 2013-03-22 15:18:11