请帮助我了解如何使用SASS到达元素,并更改标记的元素的颜色,而不添加.class或ID到元素。非常感谢
发布于 2019-11-09 09:15:39
您的HTML如下所示
<div class="content__left">
<div class="offer__item">
<h3 class="offer__title">
Lorem <span>Ipsum</span>
</h3>
</div>
<div class="offer__item">
<h3 class="offer__title">
Lorem <span>Ipsum</span>
</h3>
</div>
</div>
而SCSS将会是
.content__left {
.offer__item:nth-child(2) {
.offer__title {
span {
color: red; // your style goes here
}
}
}
}
Working fiddle Here
https://stackoverflow.com/questions/58777704
复制相似问题