Copyright 2025

The Valley of Code

A Flavio Copes project

CSS, how to select elements that do NOT have a class
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;
}

Join my AI Workshop !

The Web Development BOOTCAMP cohort starts in February 2026