sass - Nested Node in CSS -
this question has answer here:
i have like
<div> <div class="a">content</div> </div> <div> <div class="a">content</div> </div> <div> <div class="a">content</div> </div>
is there way apply adjacent sibling type rule class a, given contained within element?
for example, i'd able do:
a + { font-size: smaller; }
to apply rule first div. however, won't work traditional + operator, because applies directly adjacent elements.
div ~ div .a{ /* or: div ~ div > .a or rather div.parent ~ div.parent .a */ font-size:smaller; }
<div> <div class="a">content</div> </div> <div> <div class="a">content</div> </div> <div> <div class="a">content</div> </div>
preferabily use parent class selector more specific
Comments
Post a Comment