Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

if i want not to give color o empty and s2 do we need to create two different selector or same selector can do this?

:div-not([id="s2"]){

.....

}

:not(:empty){

}

Hi Arnab,

I'm not quite sure what you're asking here. Can you show some example html and then specify what you want to select or not select?

See this thread for how to post code: https://teamtreehouse.com/forum/posting-code-to-the-forum

1 Answer

Will this work for you?

:not(#s2),
:not(:empty) {
    // your code here
}

EDIT: Actually, better yet...

:not(#s2, :empty) {
    // your code here
}

Thanks Ryan. I was asking about the above syntax we can do it.