I am having trouble with nesting in Sass. Say I have the following HTML:
<p href="#" class="item">Text</p>
<p href="#" class="item">Text</p>
<a href="#" class="item">Link</a>
When I try to nest my styles in the following I get a compiling error:
.item {
color: black;
a& {
color:blue;
}
}
How do I reference a type selector before the parent selector when it is part of the same element?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…