0Pricing
CSS Academy · Lesson

:not() :is() and :where()

Exclude elements with :not(), match any of a list with :is(), and use :where() for low specificity.

:not() Pseudo-class

:not(selector) selects elements that do not match the given selector. It inverts the selection.

/* Style all inputs except submit buttons */
input:not([type="submit"]) {
  border: 1px solid #ccc;
}

:not() with Multiple Arguments

Modern CSS allows multiple arguments inside :not() — it matches elements that match none of the listed selectors:

a:not(.active, .disabled) {
  color: inherit;
}

All lessons in this course

  1. :hover :focus :active and :visited
  2. :nth-child and :nth-of-type
  3. :not() :is() and :where()
  4. :checked :disabled and Form State Pseudos
← Back to CSS Academy