.content-tab div:first-of-type;不建议套用多层使用,筛选会更加复杂
<template>
<div class="content-tab">
<h4>字体设计1</h4>
<div class="list-desc">样式改变1</div>
<h4>字体设计2</h4>
<div class="list-desc">样式改变2</div>
<h4>字体设计3</h4>
<div class="list-desc">样式改变3</div>
<h4>字体设计4</h4>
<div class="list-desc">样式改变4</div>
</div>
</template>
<script>
export default {
name: "HelloWorld",
props: {
msg: String,
},
data() {
return {};
},
methods: {},
mounted() {
},
};
</script>
<style scoped lang="scss">
.content-tab div:first-of-type {
font-size: 16Px;
padding: 1Px 20Px;
transform: translateY(-3Px);
font-weight: bold;
color: #3722af;
}
.content-tab div:last-of-type {
font-size: 16Px;
padding: 1Px 20Px;
transform: translateY(-3Px);
font-weight: bold;
color: #eb43b3;
}
</style>