I want to style code elements that are not inside a tags.
code
a
What is the best approach to accomplish this?
code:not(a code)
:not does not support combinator selectors.
:not
If we're talking about its direct parent:
:not(a) > code
Otherwise there's no way to do this in CSS. You'll have to override it:
code { /* some styles */ } a code { /* override previous styles */ }