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