این ترجمه ناتمام است. Please help translate this article from English

not() CSS pseudo-class:  همه عناصر را انتخاب می‌کند بجز عناصری که به عنوان ورودی به این کلاس داده شود. از آنجایی که این کلاس از انتخاب عناصر خاصی جلوگیری می کند، به عنوان negation pseudo-class شناخته می شود.
/* paragraph همه عناصر را انتخاب می‌کند بجز عنصر */
:not(p) {
  color: blue;


  • Useless selectors can be written using this pseudo-class. For example, :not(*) matches any element which is not an element, so the rule will never be applied.
  • This pseudo-class can increase the specificity of a rule. For example, #foo:not(#bar) will match the same element as the simpler #foo, but has a higher specificity.
  • :not(.foo) will match anything that isn't .foo, including <html> and <body>.
  • This selector only applies to one element; you cannot use it to exclude all ancestors. For instance, body :not(table) a will still apply to links inside of a table, since <tr> will match with the :not() part of the selector.


ورودی‌های شبه‌کلاس ()not: با ویرگول از یکدیگر جدا می‌شود.



The ability to list more than one selector is experimental and not yet widely supported.

:not( <complex-selector-list> )

<complex-selector-list> = <complex-selector>#

<complex-selector> = <compound-selector> [ <combinator>? <compound-selector> ]*

<compound-selector> = [ <type-selector>? <subclass-selector>* [ <pseudo-element-selector> <pseudo-class-selector>* ]* ]!
<combinator> = '>' | '+' | '~' | [ '||' ]

<type-selector> = <wq-name> | <ns-prefix>? '*'
<subclass-selector> = <id-selector> | <class-selector> | <attribute-selector> | <pseudo-class-selector>
<pseudo-element-selector> = ':' <pseudo-class-selector>
<pseudo-class-selector> = ':' <ident-token> | ':' <function-token> <any-value> ')'

<wq-name> = <ns-prefix>? <ident-token>
<ns-prefix> = [ <ident-token> | '*' ]? |
<id-selector> = <hash-token>
<class-selector> = '.' <ident-token>
<attribute-selector> = '[' <wq-name> ']' | '[' <wq-name> <attr-matcher> [ <string-token> | <ident-token> ] <attr-modifier>? ']'

<attr-matcher> = [ '~' | | | '^' | '$' | '*' ]? '='
<attr-modifier> = i | s



<p>این عنصر، عنصر پاراگراف است.</p>
<p class="fancy">من چقدر خوبم!</p>
<div>این عنصر، عنصر پاراگراف نیست.</div>


.fancy {
  text-shadow: 2px 2px 3px gold;

/* نیستند `fancy` که دارای کلاس <p> ِتمام عنصار */
p:not(.fancy) {
  color: green;

/* <p> همه عناصر بجز عنصر */ 
body :not(p) {
  text-decoration: underline;

/* <span> یا <div> همه عناصر بجز عناصر */
body :not(div):not(span) {
  font-weight: bold;
/* را دارا هستند `fancy` یا `crazy` همه عناصر بجز عناصری که کلاس‌های */
/* توجه داشته باشید که این نوع نوشتار هنوز پشتیبانی نمی‌شود. */
body :not(.crazy, .fancy) {
  font-family: sans-serif;



Specification Status Comment
Selectors Level 4
The definition of ':not()' in that specification.
Working Draft Extends its argument to allow some non-simple selectors.
Selectors Level 3
The definition of ':not()' in that specification.
Recommendation Initial definition.

Browser compatibility

Update compatibility data on GitHub
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Negation pseudo-class selector (:not())Chrome Full support 1Edge Full support 12Firefox Full support 1IE Full support 9Opera Full support 9.5Safari Full support 3.2WebView Android Full support 2Chrome Android Full support 18Firefox Android Full support 4Opera Android Full support 10.1Safari iOS Full support 3.2Samsung Internet Android Full support 1.0
Selector list argumentChrome No support NoEdge No support NoFirefox No support NoIE No support NoOpera No support NoSafari Full support 9WebView Android No support NoChrome Android No support NoFirefox Android No support NoOpera Android No support NoSafari iOS Full support 9Samsung Internet Android No support No


Full support  
Full support
No support  
No support