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

Madhvi Maheshwari
Madhvi Maheshwari
7,788 Points

Question is asking to write a media query for clear the left item of the gallery list item

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

and i hope i am writing it correctly but its not taking it.

please help

1 Answer

Here is the answer:

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

Here is a great article explaining why:

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

Madhvi Maheshwari
Madhvi Maheshwari
7,788 Points

Thanks mate..for replying so early..