< 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变成红色。这是什么原因呢?@官方,,哪个高手给我解答一下也可以。
nth-last-child和nth-last-of-type用法应该是不一样的,感觉在小程序里面的用法却是一样的