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

Stuck on a Web Design Challenge

Hi, I am stuck with a task, can anyone see what I am doing wrong?

Here is the question:

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

Here is the error message: Bummer! Did you set "clear: left" on every fourth gallery list item?

And here is my code:

@media screen and (min-width: 480px) {

gallery li:nth-child (4n) {

clear:left; }

gallery li {

width:28.3333%; }

}

Can anyone see what I am missing?

4 Answers

Chandler Tayek
Chandler Tayek
5,513 Points

You do not need the n in (4n) you just need the (4).

Chandler Tayek
Chandler Tayek
5,513 Points

Never mind Mateusz Marcinkiewicz works mine is definitely wrong lol, idk how to delete posts :(

Awesome Mateusz, yet in workspaces it works with a space! Crazy! :-)

Thanks Chandler, it also works as you say it dos.

Chandler Tayek
Chandler Tayek
5,513 Points

Yea but that will only work for the first 4th item and not any proceeding 4th items.