paint-brush
A Complete Guide to How the CSS Not Selector Worksby@smpnjn
290 reads

A Complete Guide to How the CSS Not Selector Works

by Johnny Simpson3mAugust 8th, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

The CSS:not()` selector is broadly supported by most browsers. It's often necessary to signpost that we want to select an element, but **not** in specific circumstances. The way it works is that we create a selector, and then specify what it should **not* be. In these instances, we can use the selector to do that. The selector also affects specificity, where certain selectors "override" others. For example, if you had `div:not(#id)` in your code, it still counts as having an `id` so the specificity increases.

Company Mentioned

Mention Thumbnail
featured image - A Complete Guide to How the CSS Not Selector Works
Johnny Simpson HackerNoon profile picture
Johnny Simpson

Johnny Simpson

@smpnjn

Product, Engineering, Web

About @smpnjn
LEARN MORE ABOUT @SMPNJN'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Johnny Simpson HackerNoon profile picture
Johnny Simpson@smpnjn
Product, Engineering, Web

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Alvinashcraft
Coffee-web
Learnrepo
Tefter
Tefter