I want to hide the parent <li>
tag if its child <a>
tag is empty. So in the following example I would like to hide the second <li>
:
<ul>
<li>
<a href="test1.html">Test 1</a>
</li>
<li>
<a></a>
</li>
<li>
<a href="test2.html">Test 2</a>
</li>
</ul>
I can reach the <a>
via li a:empty
and that works fine. But how do I get to its parent, the <li>
? Only CSS solutions, please... thanks!