Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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.