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 How to Make a Website Responsive Web Design and Testing Refactor the Layout

HELP - Inside the media query, clear the left side of every 4th list item

this is the code i've used:

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

and it keeps coming up with the error message:

Bummer! Did you set the "clear:left" on every fourth list item in the gallery.

Any help would be appreciated, being trying to figure this out for awhile.

4 Answers

Hi Teare,

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

Should be li:nth-child(4n)

Thanks for your reply, Jason!

I have removed the space and added a # to gallery as seen in other help question.

so now I have,

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

and its coming up with the error message:

Bummer! Be sure to only clear the left side of the list items when the device is 480 px wide or wide.

Again, any help would be appreciated.

That's the correct code Where are you placing it?

It should be inside the 480px media query that's at the bottom of the css.

Post the entire media query that you have at the bottom with what you're putting in for task 1 and 2.

Also, it doesn't cause a problem here but you should get into the habit of ending every declaration with a semicolon.

You're missing one after clear: left It should be clear: left;

It doesn't cause a problem when you only have a single declaration, but most of the time it will be a problem if you leave them off.

Thanks for all your help Jason!

I figured it out. I don't remember exactly what I did, but i passed the challenge nonetheless.

Thanks for the suggestion, I will get into the habit of doing that!

Thanks again for your help.

:)

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