I want to make the following inner span disappear, if it's an only child:
<div class="foo">
<span></span>
</div>
i.e. the selector should not work in this case:
<div class="foo">
<span></span>
Some text
</div>
I tried :only-child
and :last-child
which don't work, I assume because of that "Some text" text.
Some text
and existing span coming after this extra element (then reordered with flexbox or float or whatever). Then you could select the latter whether or not it comes after the extra element e.g. it's the :first-child or not