I've been attempting to apply a CSS rule to href elements while excluding a specific class (.nolink).
.content a {
border-bottom: 2px;
}
I discovered that the :not selector can achieve this, but for some reason I'm having difficulty implementing it correctly.
Here are a few variations I tried:
.content:not(.nolink) a {
border-bottom: 2px;
}
or
.content:not('.nolink') a {
border-bottom: 2px;
}
or
.content a:not('.nolink') {
border-bottom: 2px;
}
Despite making some minor adjustments, nothing seems to be working as expected. Can anyone point out what I might be doing wrong?
The CSS code I am using is for styling green hyperlinks with underline and hover effects on . However, I need to exclude certain elements with the .nolink
class from this styling rule.