I want to select BONKERS in the HTML snippet below. Its difference is that it is alone in the <code> block, while all of its siblings contain <a> . :empty is an obvious choice, but will not work due to node text. I thought I knew this, but it makes me, well, bonkers.
<ul class="Reference"> <li class="level4"> <code class="active-voice"> <a href="some/url/x" version="2"> mauve </a> </code> <li class="level8"> <code class="active-voice"> BONKERS </code> </li> <li class="level9 subclass"> <code class="active-voice"> <a href="some/url/c" version="2"> cerise </a> </code> </li> </ul>
I need a clean CSS solution (JS is not an option) and have no control over the original HTML.
Feh!
source share