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 trialKyle Higginson
9,600 PointsMedia Query difficulties
The code challenge is asking me to select the gallery and remove the fourth column. I really think I have the code correct but it keeps rejecting it. Here is my code:
#gallery li:nth-child (4n) { clear: left; }
any help would be much appreciated! thanks!
3 Answers
Jeff Busch
19,287 PointsHi Kyle,
Remove the n from (4n) and remove the space between child and (4n).
Jeff
#gallery li:nth-child(4) {
clear: left;
}
Manuel Palma
6,144 PointsWith clear:left you're removing the float from the element. Maybe you mean "display:none;"
Kyle Higginson
9,600 Points"Inside the media query, clear the left side of every 4th list item in the gallery."
That is specifically what the code challenge is asking me to do. I should have initially typed out the whole question haha.
Marty Hitchcock
13,108 PointsBeen awhile since I have done that but have you tried replacing "li" with either "ul" or "ol"? I read that code as selecting the children of an element, and the list items are the children you want to be selecting rather than the parent.
Kyle Higginson
9,600 PointsKyle Higginson
9,600 PointsThanks Jeff! fixed my problem
Jason Anello
Courses Plus Student 94,610 PointsJason Anello
Courses Plus Student 94,610 PointsIt's every 4th list item.
Should be
4n
.4
will select the 4th item only.This challenge passes with many incorrect answers and the staff is working on it last I heard.