Sometimes, we wabnt to select :hover but :not on a specific class with CSS.
In this article, we’ll look at how to select :hover but :not on a specific class with CSS.
How to select :hover but :not on a specific class with CSS?
To select :hover but :not on a specific class with CSS, we use :not
and :hover
together.
For instance, we write
a:not(.active):hover {
//...
}
to select a
elements with classes that don’t have the active
class.
And we select the ones that are hovered over with :hover
.
Conclusion
To select :hover but :not on a specific class with CSS, we use :not
and :hover
together.