The :Not Pseudo-Class
The :not(selector) selector matches every element that is NOT the specified element/selector. In this example, it will set a background color for all elements that are not a <p> element:
HTML file: | Displayed by browser: |
---|---|
<style>
<body>
|
This is a headingThis is a paragraph. This is another paragraph. This is some text in a div element.
This is a Link!
|
Note: Wow, almost everything was red on this webpage. I had to put everything in paragraph code, with inline styling, to keep them from being red!