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

Code Challenge not working?

Help please

Screenshot of challenge

Already tried refreshing, and previous code challenge was ok.

If you remove the n from 4n, it should work fine!

@media screen and (min-width: 480px) {

#gallery li {
width: 28.3333%;
}

#gallery li:nth child(4) 
clear: left;
}

5 Answers

Dave McFarland
STAFF
Dave McFarland
Treehouse Teacher

Hi Carlos Herrera

You have a space between li:nth-child and (4n). Should be li:nth-child(4n) not li:nth-child (4n)

See this post on CSS Tricks for an explanation of nth-child:

https://css-tricks.com/how-nth-child-works/

HTH,

Ethan

Thanks for the link Ethan, very useful explanation. Still I don't see the error and I can't make it work. In my workspace it works fine and it's the same code.

Carlos, look more closely at your code. Your nth child code is missing the opening curly bracket.

That's not my code, that's a screenshot from Max, mine is this one http://i.imgur.com/TQ4FMfQ.png

Change (4n) to (4). That should do the trick.

Already tried that, still a bummer. Already sent an e-mail to teamtreehouse, thank you Ethan!

Good luck, Carlos.