pseudo-class

:not() Negation Pseudo-Class

Matches elements that do not match any of the selectors in its argument list. Modern browsers accept complex selector lists inside :not().

:not(selector)

Example

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

✓ Matches

  • <input type="text">
  • <input type="email">
  • <input>

✗ Does not match

  • <input type="submit">
  • <button>Save</button> because it is not an input at all

Browser support

Widely supported since CSS3; selector list argument since 2021.

Related selectors

← All CSS selectors · CSS selectors cheat sheet