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 trialNicholas Cipponeri
2,987 Pointshow do i set clear left on every fourth gallery list item
What is wrong with my code?
@media screen and (min-width: 480px) {
#gallery li{
width: 28.3333%;
}
#gallery li: nth-child(4n) {
clear: left;
}
}
3 Answers
Jason Anello
Courses Plus Student 94,610 PointsHi Nicholas,
You have a space after the colon :
in your nth-child selector which is invalid syntax.
Remove that space and you should pass.
#gallery li:nth-child(4n) {
Gregor Weindl
3,271 Pointsset the nth-child to (4n + 4) which means start with the 4th and then every 4th.
Brandon Burton
9,688 PointsYou've got an extra pair of braces there. Everything else is correct.
It should read:
'''#gallery li: nth-child(4n) { clear: left; }'''
Still learning to use Markdown. My apologies for the bad formatting but I hope this helps!
Nicholas Cipponeri
2,987 PointsNicholas Cipponeri
2,987 PointsHi Jason,
I went back and you are right, there was an extra space after the colon. Thank you!