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 trialJesse Alair
4,675 PointsI can't get my code to pass on #gallery li:nth-child(4).
Hello my name is Jesse Alair and I'm having trouble getting a code challenge to pass. I am in the Web Design Track, inside the "How to Make a Website Course". I am doing the Code Challenge "Refactor the Layout" inside the Responsive Web Design and Testing section, Task #2. I'm pretty sure my code is right because I've checked it with my code from Workspaces that I've been following along with Nick Pettit. I can't find any bugs and can't seem to get it to pass no matter what I try.
The question reads, "Now, clear the left side of every 4th list item in the element with the id of "gallery". Here's a hint: You'll need to write another selector inside of the media query at the bottom of the file, in addition to the one you wrote in the previous step. You'll also need to use the nth-child pseudo selector."
Here is my code:
@media screen and (min-width: 480px) {
#gallery li {
width: 28.3333%;
}
#gallery li:nth-child(4) {
clear: left;
}
}
2 Answers
pi R
12,720 PointsHm, you can try with (4n) You can also test any of your attempts here : https://css-tricks.com/examples/nth-child-tester/#
Enrique Solano
753 Pointsi still don't get this im going to the website I saw but, I don't get this at all. I need help.
Daniel Roman
2,867 PointsWhat kind of problems are you having Enrique?
Jesse Alair
4,675 PointsJesse Alair
4,675 PointsThanks! That worked!
I can finally continue!