← TechnologyThe essentials of

:not() excludes matching items

Publisher: ResumeMaker • 1 source

Published: 22 Oct 2026 13:13 · Updated: 22 Oct 2026 13:13

AI source check: 21 Oct 2026 13:48. This is not editorial approval.

In a few sentences

In brief

Denial refers to the selected item, not automatically to an entire branch.

Useful to know

:not() selects an item that does not match the submitted selector or list. The example button:not(:disabled) means buttons that are not turned off. [1]

In .item:not(.archived) the class of .item. itself is checked Having a parent .archived is not the same condition. This is a common reason a rule affects more items than expected. Specificity comes from arguments, so complex negations can weigh in on the cascade. For clearer verification, first formulate exactly which element you want to exclude.

Sources

For further detail and to check the information:

  1. [1] MDN — :not ↗