I want to select BONKERS in the HTML fragment below. Its distinction is that it's alone in a <code>
block whereas all its siblings contain <a>
's. :empty
is the obvious choice, but won't work due to the text node. I thought I knew this stuff but this is driving 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 pure CSS solution (JS isn't an option), and have no control over the source HTML.
Feh!
See Question&Answers more detail:os