I got following markup:
<div>
<p class="active"></p>
<p></p>
<p class="active"></p>
<p></p>
</div>
At one point I get this markup:
<div>
<p></p>
<p></p>
<p class="active"></p>
<p></p>
</div>
Now I want to style the active class, but only if there is only one active class within the div. If there are more than one active class their should be different styling. Something like:
div .active{
color: red;
}
div .active:only-child{
color:green;
}
If there a way achieving this without js? Only CSS?