好家伙,我有以下..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