Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
July 22, 2019 09:39 pm GMT

CSS :not() with Multiple Classes

Say you want to select an element when it doesn't have a certain class. That's what the :not() selector is for.

body:not(.home) {  }

But what if there are multiple classes you want to avoid?

There are no logical combinators with :not(), like and or or, but you can chain them, which is effectively like and.

body:not(.home):not(.away):not(.page-50) {  }

The :not() selector doesn't add any specificy by itself, but what is inside does, so :not(.foo) adds the … Read article

The post CSS :not() with Multiple Classes appeared first on CSS-Tricks.


Original Link: https://css-tricks.com/css-not-with-multiple-classes/

Share this article:    Share on Facebook
View Full Article

CSS Tricks

A Web Design Community curated by Chris Coyier

More About this Source Visit CSS Tricks