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 : 88 rpx; line-height : 88 rpx; text-align : center ; box-sizing: border-box; width : 200 rpx; font-size : 30 rpx; color : var(--sc- green ); transition: color . 2 s 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能识别,这是怎么回事?