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 trialMaren Linkugel
5,220 Pointsnth-child question
I can't seem to figure out this task in the Responsive Web Design quiz:
Challenge task 2 of 2 Inside the media query, clear the left side of every 4th list item in the gallery.
I tried these but they are not working. Ideas?
gallery li: nth-child (4n) {
clear: left;
}
and also I tried:
gallery li: nth-child (3n+1) {
clear: left;
}
4 Answers
Jason Anello
Courses Plus Student 94,610 PointsHi Maren,
It's expecting the 1st one given that it says to clear every 4th item.
The only problem you have is that you need to remove the space after :
and the space after nth-child
Should be #gallery li:nth-child(4n) {
Twiz T
12,588 PointsIs gallery an id or a class name perhaps?
notf0und
11,940 PointsI believe
#gallery li:nth-child(4n+4) {
clear: left;
}
should work. In nth-child, the first number is the starting point, and the second number is the skip value.
jase richards
10,379 Points yeah, your code is missing the hash '#' to call the gallery.