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.

general sibling combinator ~

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

Popular posts from this blog

javascript - Using jquery append to add option values into a select element not working -

Android soft keyboard reverts to default keyboard on orientation change -

jquery - javascript onscroll fade same class but with different div -