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

CSS How to Make a Website Responsive Web Design and Testing Refactor the Layout

Code challenge error

Code challenge is showing me an error for "clear the left side of every 4th item in the gallery". My css is as follows

#gallery li:nth-child (4n) { 
    clear: left;
}
Dave McFarland
Dave McFarland
Treehouse Teacher

There's no space between nth-child and (4n)

Thanks Dave for your help.

2 Answers

Thanks Jamie for you reply. I was just adding a space between child and parenthesis. Silly of me to do so.

James Barnett
James Barnett
39,199 Points

In CSS remember spaces are syntactically significant as they refer to descendant selectors.

  #gallery li:nth-child(4n) {
    clear: left;
  }

works. Did you forget to add the id tag before gallery?