I have a rather unique query. How can I create a selector that targets a specific part of the hierarchy based on classes? For instance, I'd like to select something like:
<node class="start-selection">
<node>
<node>content affected</node>
</node>
<node>
<node>content affected</node>
</node>
<node class="end-selection">
<node>
<node>content not affected</node>
</node>
</node>
<node>
<node>content affected</node>
</node>
</node>
I'm considering something like this:
.start-selection, .start-selection *:not(.end-selection, .end-selection *){
/*styling...*/
}
However, it seems that this approach doesn't work because compound selectors cannot be used in the :not() pseudo class. Do I have to resort to using JavaScript to achieve this? Thanks.