I want a CSS selector that matches the <code>
in:
<p><code>foo</code> bar</p>
but not the <code>
in:
<p>foo <code>bar</code></p>
code:first-child
doesn't work. It matches both.
Asking just because I don't think it's possible.
I figured I'd give the community a shot before giving up.
Edit - people keep marking this as duplicate, so let me be clear: if the current top answer is correct then the answer to the question you're referencing has the same root cause, but that does not make it the same question. It is entirely possible for the answers to the two questions to differ--or if it isn't, the "why" of that is an answer only to this question, not that one.
foo
? Then your selector code:first-child would work. – deadfishli Oct 24 '17 at 21:39bar