user image

Jo Micheal
Published in : 2022-07-25

Multiple classes in :not() function in CSS

HTML & CSS

Hello everyone,
How can I use :not with multiple classes? I am trying 

div:not(.light, .dark){/* CSS code */}

and it's not working, any suggestions?   

Comments

Mohamed Atef Date : 2022-07-25

Best answers

51

Best answers

51

You can use it like this and it will work with you

div:not(.light):not(.dark){/* CSS code */}

Jo Micheal Date : 2022-07-25

Thanks this works 

Leave a comment

Join us

Join our community and get the chance to solve your code issues & share your opinion with us

Sign up Now

Related posts

Flex Box last column break to the next row
Publish date: 2022-02-10 | Comments: 1

Tag: HTML & CSS

min-height is not working on td or th
Publish date: 2021-10-20 | Comments: 1

Tag: HTML & CSS

Do I have to upload the sass files or just the CSS file?
Publish date: 2022-02-11 | Comments: 1

Tag: HTML & CSS

Logo shrinks when resizing the browser
Publish date: 2022-02-10 | Comments: 2

Tag: HTML & CSS

What is the need for using (for) attr in the label of an input tag?
Publish date: 2022-02-11 | Comments: 2

Tag: HTML & CSS

Searching for a better way to use abstracts in Dart SASS
Publish date: 2022-02-10 | Comments: 0

Tag: HTML & CSS

Sticky header goes behind the Images
Publish date: 2022-02-10 | Comments: 1

Tag: HTML & CSS

How to horizontally align to the centre a li inside an ul?
Publish date: 2022-03-04 | Comments: 2

Tag: HTML & CSS