August 27, 2015
css selector for a node which doesn't contain a given selector with class attribute
Abc123’s Question:
How do I select the entire h4 node that doesn’t contain h3 with class=”avoid”? In this case I want to select the first and fourth h4 node.
<div>
<h4>
<h1><h1>
<h2><h2>
</h4>
<h4>
<h1><h1>
<h2><h2>
<h3 class="avoid"><h3>
</h4>
<h4>
<h1><h1>
<h2><h2>
<h3 class="avoid"><h3>
</h4>
<h4>
<h1><h1>
<h2><h2>
</h4>
</div>