I would like to use a CSS selector to select a specific child TAG but only if parent has no other children or text.
In this specific case the <a>
tag that needs to be selected is wrapped in a <p>
tag.
I'm looking for a CSS-only solution (I'm curious to know if it's actually possible)
<p><a>This is selected</a></p> // selected
<p><a>This is NOT selected</a><span>other children</span></p> // NOT selected
<p><a>This is NOT selected</a>Other text</p> // NOT selected
This is NOT selectedOther text
// NOT selected` – juniorDEV May 06 '22 at 15:54