1

I have to change the style of everything on an entire page, except for a huge list of exempted elements. Apparently CSS not() doesn't support a comma syntax like this: :not(p, div). Do I have to just make a huge list like the one below, repeating the style for each one, or is there a quicker solution?

:not(p){xyz}
:not(div){xyz}
:not(a){xyz}

1 Answer 1

4

Try

:not(p):not(div):not(a){xyz}

http://jsfiddle.net/mowglisanu/MA3nM/

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks. I'll just search and replace to put that down a hundred times... Seems silly that there's no comma notation.
@Nate Glenn: Thankfully, that's coming in Selectors 4. Better late than never!
@BoltClock Interesting. That'll sure be nice. Here's another link for the future.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.