I know I can select the descendant or sibling of a specific class with combinators. I have a situation where I want to style an element on any page where a totally separate element contains a certain class. This is for a wordpress site where some pages have a particular category, which adds that category's name to an element on the page. I want to style a totally separate element on any of those pages, but the element is not a descendant or sibling of the one with the class I'm looking for.
Imagine this simplified scenario:
<div>
<div>
<div class="desired-cat"></div>
</div>
<div>
<div>
<div>
<div class="target-element"></div>
</div>
<div>
Is it possible for me to style .target-element on any page where .desired-cat is used somewhere on that page? Thanks!