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

float: left; not passing validation in "Styling Web Pages and Navigation", Challenge Task 3.

I'm in section "Styling Web Pages and Navigation", and doing challenge task 3.

The task is "Select the list items nested inside the gallery. Float them to the left and set the width to 45%.".

I've entered the following code:

#gallery li {
  float: left;
  width: 45%;
}

The validation response is "Bummer! Be sure to float the gallery list items to the left."

This is the same code that was shown in the instruction video. I also entered this same code in the workspace whilst following the video, and it worked there.

Any idea what I'm doing wrong?

1 Answer

I passed using that code. Maybe there's an error somewhere else in your CSS?

You're correct. After spending 10 minutes staring at the code I noticed there was an extra semi-colon just a little above.

#gallery {
  margin: 0;
  padding: 0;
  list-style: none;
};

#gallery li {
  float: left;
  width: 45%;
}

Thanks.

No problem ^^