Skip to content
FLAVIO COPES
flaviocopes.com
2026

CSS, how to select elements that do NOT have a class

~~~

To select elements in an HTML document that do NOT have a class, you can use this:

:not(.class)

For example:

p:not(.description) {
  color: red;
}
~~~

Related posts about css: