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

HTML How to Make a Website Responsive Web Design and Testing Refactor the Layout

Code Challenge code not working.

Step one was to set the width of the gallery list items inside a media query and that worked. Now its asking to clear the 4th item in the list using clear left. I keep getting "Bummer! Did you use "clear: left;"

Here is my code, which is inside the media query at the bottom of the css:

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

2 Answers

That worked but this may want to be changed as it still works without the n in practice and in the video and explanation that is never mentioned.

Thank you for your help and it worked!!

Steven Parker
Steven Parker
231,007 Points

It might look like it works the same, but li:nth-child(4) would select the 4th list item. Yet what the challenge asks is to select every 4th list item, so that's li:nth-child(4n).

Konrad Pilch
Konrad Pilch
2,435 Points

Press edit and wrap your code with

```css

code here

```

SO we can read and see the code. If you cant do it, let me know i do it and you check it on how i did it.

Done, and sorry, new to the forums. Loving the fast responses and positive energy though.

Konrad Pilch
Konrad Pilch
2,435 Points

I know :) i jsut want people to learn how to format the code correctly so it saves in time in the future because sometimes a mod wont see it and you could be stuck for few hours because no on can see the code.