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 trial
Nicole Cioffi
608 PointsUsing code to clear space to left of gallery image not working
I am using the code required for removing space from one side of a specific image on my gallery homepage. It worked for the instructor and I followed him and wrote the code identically. Is there another reason this may not work? Like perhaps the sizes of my images? I'm using the code #gallery li:nth-child(4n) { clear: left}
This is not effectively clearing the space to the left of the fourth image however. Any help would be great. Thank you!!
3 Answers
Ragav Raman
7,412 PointsYou need to add a semicolon after the CSS declaration. Your CSS should have been this:
#gallery li:nth-child(4n) {
clear: left;
}
Nicole Cioffi
608 PointsThabks for your response .. I did change that and it's still not working. I'm not sure what else to try
Ragav Raman
7,412 PointsCan you post all the code you used?
Nicole Cioffi
608 Points/********** PAGE PORTFOLIO **********/
gallery li {
width: 28.3333%;
}
#gallery li:nth-child(4n) { clear: left; } }
Ragav Raman
7,412 PointsMaybe it's the extra curly bracket at the end of the block.
#gallery li:nth-child(4n) {
clear: left;
}