I need a CSS selector that matches <code>
in:
<p><code>foo</code> bar</p>
but not <code>
in:
<p>foo <code>bar</code></p>
code:first-child
does not work. It matches both.
Ask only because I don’t think it is possible.
I decided that I would give the community a shot before giving up.
Change - people continue to mark this as a duplicate, so let me be clear: if the current correct answer is correct, the answer to the question you are referring to has the same reason, but does not make the same question. It is possible that the answers to the two questions will differ - or, if this is not the case, the "why" is the answer only to this question, and not the one.
source
share