CSS :not Selector Read Courses Practice Improve Improve Improve Like Article Like Save Article Save Report issue Report The :not(selector) selector is used to style every element that is not the specified by selector. Since it prevents specific items from being selected, it is also known as the negation pseudo-class. Syntax: :not(selector) { //CSS Property } Example-1: html <!DOCTYPE html> <html> <head> <title> CSS :not selector </title> <style> p { color: #000000; } :not(p) { color: green; } </style> </head> <body style="text-align: center;"> <h1> CSS :not selector </h1> <p> A computer science portal for geeks. </p> <div> Geeks classes an extensive classroom programme. </div> </body> </html> Output: Example-2: html <!DOCTYPE html> <html> <head> <title> CSS :not selector </title> <style> /* Style everything but not one named .geek class */ li:not(.geek) { color: green; } </style> </head> <body style="text-align: center;"> <h1 style="color:green;"> CSS :not selector </h1> <p> Sorting Algorithms </p> <ul> <li>Merge sort</li> <li class="geek">Bubble sort</li> <li>Quick sort</li> </ul> </body> </html> Output: Supported Browsers: The browser supported by :not selector are listed below: Apple Safari 3.1 and above Google Chrome 1.0 and above Edge 12.0 and above Firefox 1.0 and above Opera 9.5 and above Internet Explorer 9.0 and above Learn to code easily with our course Coding for Everyone. This course is accessible and designed for everyone, even if you're new to coding. Start today and join millions on a journey to improve your skills!Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now! Commit to GfG's Three-90 Challenge! Purchase a course, complete 90% in 90 days, and save 90% cost click here to explore. Last Updated : 07 Jun, 2023 Like Article Save Article Previous CSS :link Selector Next CSS :nth-child() Selector Share your thoughts in the comments Add Your Comment Please Login to comment...