使用:not(:last-child) 来选择集合中非最后一个的元素
<div class="zone-tab">
<img class="tab-item"/>
</div>
<style lang="less">
.zone-tab {
.tab-item {
width: 2.2rem;
height: 1.9rem;
&:not(:last-child) {
margin-right: 0.2rem;
}
}
}
</style>