Hosting Solutions
mobile_logo Table of Contents
seal_frontseal_back

not

The not negation pseudo-class selector is used to exclude specified elements. Use it to exclude a specified element in an otherwise full sibling selection.
Syntax Logicelement:not( excluded_elements ) { property_list }

CSS Code Example

<style> h2:not(.class1) { color: magenta; } </style> <h2>Some Stuff</h2> <h2 class="class1">More Stuff</h2> <h2>More Stuff</h2> <style> .class1:not(h2) { color: magenta; } </style> <h1 class="class1">Some Stuff</h1> <h2 class="class1">Some Stuff</h2> <h3 class="class1">Some Stuff</h3>

CSS

Selectors

universaltypecompoundclassidnotattributedescendantchildadjacent siblinggeneral siblingfirst childlast childonly childfirst of typelast of typeonly of typenth childnth last childnth of typenth last of typeemptyrootfirst linefirst letterbeforeafterlinkvisitedhoveractivefocustargetenableddisabledcheckedlang