You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Negation Pseudo-class: <aclass=cssdata-link-type=maybehref=#negation-pseudotitle=:not()>:not()</a></span><aclass=self-linkhref=#negation></a></h3>
1475
1475
1476
-
<p>The negation pseudo-class, <dfnclass=css-codedata-dfn-type=selectordata-export="" id=negation-pseudo>:not()<aclass=self-linkhref=#negation-pseudo></a></dfn>, is a
1477
-
functional pseudo-class taking a <ahref=#grouping>selector list</a>
1478
-
as an argument. It represents an element that is not represented
is a functional pseudo-class taking a <adata-link-type=dfnhref=#selector-listtitle="selector list">selector list</a> as an argument.
1478
+
It represents an element that is not represented by its argument.</p>
1480
1479
1481
1480
<pclass=note>Note: In Selectors Level 3,
1482
1481
only a single <adata-link-type=dfnhref=#simpletitle="simple selector">simple selector</a> was allowed as the argument to <aclass=cssdata-link-type=maybehref=#negation-pseudotitle=:not()>:not()</a>.</p>
1483
1482
1484
-
<p>A negation may not be nested within itself or within <aclass=cssdata-link-type=maybehref=#matches-pseudotitle=:matches()>:matches()</a>:
1485
-
<spanclass=cssdata-link-type=maybetitle=:not(:not(...))>:not(:not(...))</span> and <spanclass=cssdata-link-type=maybetitle=:matches(:not(...))>:matches(:not(...))</span> are invalid.
1486
-
Additionally, pseudo-elements cannot be represented by the negation pseudo-class;
1483
+
<p>Pseudo-elements cannot be represented by the negation pseudo-class;
1487
1484
they are not valid within <aclass=cssdata-link-type=maybehref=#negation-pseudotitle=:not()>:not()</a>.</p>
within a negation pseudo-class unless the argument is an explicit universal
1507
1504
selector or a type selector. (See <aclass=cssdata-link-type=maybehref=#matches-pseudotitle=:matches()>:matches()</a>for examples.)</p>
1508
1505
1509
-
<pclass=note>Note: The <aclass=cssdata-link-type=maybehref=#negation-pseudotitle=:not()>:not()</a> pseudo allows
1510
-
useless selectors to be written. For instance <spanclass=cssdata-link-type=maybetitle=:not(*|*)>:not(*|*)</span>,
1511
-
which represents no element at all, or <spanclass=cssdata-link-type=maybetitle=foo:not(bar)>foo:not(bar)</span>,
1512
-
which is equivalent to <spanclass=cssdata-link-type=maybetitle=foo>foo</span> but with a higher
1513
-
specificity.</p>
1506
+
<pclass=note>Note: The <aclass=cssdata-link-type=maybehref=#negation-pseudotitle=:not()>:not()</a> pseudo-class allows useless selectors to be written.
1507
+
For instance <spanclass=cssdata-link-type=maybetitle=:not(*|*)>:not(*|*)</span>, which represents no element at all,
1508
+
or <spanclass=cssdata-link-type=maybetitle=div:not(span)>div:not(span)</span>, which is equivalent to <spanclass=cssdata-link-type=maybetitle=div>div</span> but with a higher specificity.</p>
0 commit comments