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 trialSteve Davies
10,389 PointsStuck 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
Mateusz Marcinkiewicz
2,142 Pointstry without space nth-child(4n)
Chandler Tayek
5,513 PointsYou do not need the n in (4n) you just need the (4).
Chandler Tayek
5,513 PointsNever mind Mateusz Marcinkiewicz works mine is definitely wrong lol, idk how to delete posts :(
Steve Davies
10,389 PointsAwesome Mateusz, yet in workspaces it works with a space! Crazy! :-)
Steve Davies
10,389 PointsThanks Chandler, it also works as you say it dos.
Chandler Tayek
5,513 PointsYea but that will only work for the first 4th item and not any proceeding 4th items.