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

Don't Understand what I'm doing wrong in Code Challenge

I'm about positive I'm typing this write ... but I still am receiving an error on the code challenge.

It says: Inside the media query, clear the left side of every 4th list item. My code is:

*Inside the media query *

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

I was really positive on my code, and I checked and it's even the same code as in the lesson. But I don't know what I'm doing wrong Any help is greatly appreciated, thank you for your time

Hi Zach,

I went ahead and fixed your code formatting for you.

This thread will show you how to do that: https://teamtreehouse.com/forum/posting-code-to-the-forum

I also changed the category to "CSS" as that is more appropriate but it looks like that lost all the other tags that you had set.

I will check with staff on that.

Did you have this tagged with what code challenge it was from?

Does anyone else who posted here remember if there was additional tags posted indicating the sub-topic and the challenge it was from? The main topic was html and I thought there were 3 more tags.

David Miller or Jeremy Germenis ?

Thank you for your link. I did have the tag, it was from the subtopic HTML and the challenge was from The How To Make A Website - Refractor the Layout ... question 2.

Thanks for the update. It sounds like there were 3 tags showing then and now there is only the main category showing. "CSS"

I will check in with staff then as this seems to be a problem and I'll stop changing main categories until this is resolved.

Sorry about that.

If David Miller's answer helped you then please consider awarding "best answer" there so others helping out in the forums will know this question has been solved.

5 Answers

Zach, you may have to remove the space between li: and nth-child(4n), but you also are missing an # before gallery, which is required because it is an ID.

Should read:

gallery li:nth-child(4n) {

clear: left; }

edit: # doesn't show up in text in front of gallery

Is gallery an id or a class?

It is an ID, I do have an # ... but it's not showing up on my post

Hi Zach,

You have a space after li: that you need to remove.

Try removing that space then.