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

State 8, Responsive Web Design and Testing, Challenge task 2 of 2

I'm pretty sure my code is correct. I'm getting a weird error though that doesn't make any sense given the tasks for this stage.

Challenge: Inside the media query, clear the left side of every 4th list item in the gallery.

(the previous challenge was to set a width on all list items in the gallery, of 28.3333%)

My code:

@media screen and (min-width: 480px) {
   #gallery li {
     width: 28.3333%;
   }
   #gallery li:nth-child(3) {
     clear: left;
   }
 }

it won't format that right ^

The weird error: "Bummer! Be sure you're only setting the width on every 4th list item."

Huh? This challenge has nothing to do with setting a width. It's for clearing the float.

The only thing I'm not sure about is if I'm selecting the right list item. So I tried using the numbers 4 and 5 in the parentheses, but still got an error.

It was a different error: "Bummer! Did you set "clear: left" on every fourth gallery list item?"

This seems to indicate it isn't the right number in there.... I'm totally confused.

1 Answer

Derp I'm a dork. I missed the part about it being every fourth list item.

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