CSS中的first-of-type不能正常使用怎么办?
代码如下:
<view class="tab-groups"> <view class="selector"></view> <block wx:for="{{tabs}}"> <view bind:tap="switchTab" class="tab" data-index="{{index}}">{{item}}</view> </block></view> |
.tab-groups > .tab { display: inline-block; height: 88rpx; line-height: 88rpx; text-align: center; box-sizing: border-box; width: 200rpx; font-size: 30rpx; color: var(--sc-green); transition: color .2s ease; position: absolute; z-index: 1;}.tab-groups .tab:first-of-type { left: 0; /*不能正常显示*/}.tab-groups .tab:last-of-type { right: 0;} |
实际结果是.tab:first-of-type不能识别,只有last-of-type能识别,这是怎么回事?

