I have an app with relatively complex DOM structure with 20+ layers of divs.
If I have a div with class="active"
somewhere in the middle of the tree, how can I select it's parent n layers up in the tree using CSS?
For example, how do I select the div marked in uppercase (4 layers up) in the following tree ? :
<DIV>
<div>
<div>
<div>
<div class="active">
</div>
</div>
<div>
</div>
</div>
</div>
</DIV>
Same considering first-child ? How to select a first-child n layers down the tree ?