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 CSS Selectors Going Further with Attribute Selectors and Pseudo-Classes Structural and Element States Pseudo-Classes Review

Andrea Rios
seal-mask
.a{fill-rule:evenodd;}techdegree
Andrea Rios
Front End Web Development Techdegree Student 10,078 Points

Which of the following pseudo-classes can we use to target elements with no child content?

I was not able to figure this one out.

The answers were not() also :empty, i think onlychild and something else.

I don't understand the question.

I still passed the quiz, but I had this one wrong.

Thank you!

1 Answer

Steven Parker
Steven Parker
229,788 Points

The question is asking for a way to identify elements that have no child elements. Another way to describe an element has no child elements inside it would be to call it "empty".

So the :empty pseudo-class would target elements that have no contents. None of the other choices are selectors that work based on a lack of contents.