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

General Discussion

Jim Ashley
Jim Ashley
3,935 Points

Structural Pseudo-classes Code Challenge

OK, so this is fairly basic stuff, but I'm not getting anywhere with the 3rd task on the Structural Pseudo-classes Code Challenge.

'Create a new rule that selects the first 4 list items only. Set the font weight to bold.'

To which I have used:

li:nth-child(-n+4) { font-weight:'strong'; }

This is not correct (Check the selector in your CSS.)...... but, I'm not sure why.

As, I say, I'm annoyed that I'm stumped at something so basic, but any pointers would be gratefully appreciated(!)

2 Answers

Shawna Mattison
Shawna Mattison
5,312 Points

I just revisited that code challenge and was playing around a bit. Even though the message you're getting says to check the selector, your selector is fine. It's the value for font-weight that's not right. As I was playing, I got the same "wrong selector" error message even with the correct selector so I think there is a little bug in the code challenge.

Jim Ashley
Jim Ashley
3,935 Points

Shawna, thanks for replying to this. I couldn't see the wood for the trees! Sorted now. Thanks again.