I'm trying to style all a
tags that are not inside of a p
tag. Here's what I'm thinking:
p {
font-size: 1.25rem
}
a {
color: blue;
text-decoration: underline;
}
:not(p) a {
font-size: .75rem;
}
<div>
<p>There is a <a>link</a> inside this paragraph</p>
<a>Regular Link</a>
</div>
How can I fix this? Can you not use the :not()
selector without a tag in front of it? (no js/jQuery solutions please)