.content p { &:nth-of-type(1) { color: red; }
<template>
<div class="content">
<p>111111</p>
<p>22222</p>
<p>33333</p>
<p>444444</p>
<p>555555</p>
<p>666666</p>
</div>
</template>
<script>
export default {
name: "HelloWorld",
props: {
msg: String,
},
data() {
return {};
},
methods: {},
mounted() {},
};
</script>
<style scoped lang="scss">
.content p {
&:nth-of-type(1) {
color: red;
}
&:nth-of-type(2) {
color: brown;
}
&:nth-of-type(3) {
color: blueviolet;
}
&:nth-of-type(4) {
color: burlywood;
}
}
</style>