I need to apply a style to an element if a particular class is NOT a child of this element.
<table class="printlist" style="width:100%"> <tbody> <tr class="list_wanted0"><td>Whatever...</td></tr> <tr class="list_wanted1"><td> <div class="journal"> <table><tbody> <tr><td style="width: 9em">2011-03-12 09:36</td></tr> </tbody></table> </div> </td></tr> </tbody> </table>
The above example is minimized to demonstrate structure.
I want the :Hover properties only apply to .printlist tr if <tr> has a child of NO .journal .
.list_wanted0 and .list_wanted1 cannot be used to select .journal , these can be other class names.
The CSS I tried is:
.printlist tr:Hover * :not(itemjournal) { color: #000; background: #aaa }
Obviously, this does not work as I intended.
If you need more information, feel free to ask,
Thanks.
source share