HTML CSS examples for CSS Selector:not
The :not(selector) selector negates the selection.
Select all elements that are not a <p> element:
<!DOCTYPE html> <html> <head> <style> p {<!--from w w w . j a v a 2s . c om--> color: #000000; } :not(p) { color: #ff0000; } </style> </head> <body> <h1>This is a heading</h1> <p>This is a paragraph.</p> <p>This is another paragraph.</p> <div>This is some text in a div element.</div> <a href="https://www.java2s.com" target="_blank">Link!</a> </body> </html>