nth-last-of-type不太准确
< view class = 'fff' > < view class = 'fd' >6</ view > < view class = 'dd' >1</ view > < view class = 'dd' >2</ view > < view class = 'dd' >3</ view > < view class = 'dd' >4</ view > < view class = 'fd' >5</ view > </ view > |
.fff .dd:nth-last-of-type( 1 ){ color : red ; } |
这段代码,用nth-last-of-type(1)设置的话,应该4的颜色变成红色,然后没有任何一个变成红色;当换成nth-last-of-type(2)的时候,4的颜色变成红色。但是在其它编译器里面nth-last-of-type(1)就会使4变成红色。这是什么原因呢?@官方,,哪个高手给我解答一下也可以。