:not(s1, s2)

Negation

The :not() pseudo-class first appeared in CSS3, when it only allowed a maximum of 1 simple selector as an argument. In level 4 selectors, it can take a list of selectors as an argument. The styles are applied to the elements which are not represented by the passed arguments.

In CSS3, the :not selector only allows 1 selector as an argument. In level 4 selectors, it can take a selector list as an argument.

Browser Support (tested using latest versions)

Desktop
Google Chrome
No
Mozilla Firefox
No
Safari
Yes
Opera Browser
No
Internet Explorer
No
Mobile
Android Browser
No
Chrome for Android
No
Mozilla Firefox Mobile
No
Safari iOS
No
Opera Mobile
No
IE Mobile
No

Syntax

E:not(s1, s2, ...) {
/* Where s1 and s2 are two different selectors. */
}

Example

/* In this example, all p elements will be red, except for the first child and the ones with the class special. */

p:not(:first-child, .special) {
color: red;
}

Information is based on Selectors Level 4 - W3C Working Draft (last updated on May 2, 2013)
Copyright © 2013 W3C® (MIT, ERCIM, Keio, Beihang), All Rights Reserved. W3C liability, trademark and document use rules apply.