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

HTML How to Make a Website Styling Web Pages and Navigation Style the Image Captions

I didnt misspelled gallery yet float is still not working for my code ...

<li id="gallery"> <a href="img/numbers-01.jpg"> <img src="img/numbers-01.jpg" alt=""> <p>Description 1</p> </a> </li> <li> <a href="img/numbers-02.jpg"> <img src="img/numbers-02.jpg" alt=""> <p>Description 2</p> </a> </li>

gallery li{

float: left; width:45%; margin:2.5%; background-color:#5f5f5f; color:#bdc3c7; }

2 Answers

Ari Misha
Ari Misha
19,323 Points

Hiya Stefan!

  • First off, You are very close. All ya have to do is remove "li", coz you have already selected id "gallery" of "<li>" tag. So just remove "li".
  • Second off, whenever you want to select any "id" in css, all ya have to do is put "#"(hash) infront on the id name. Whereas, you've to do the same for "class" as well except any class should start with "." (dot) .

So your code should be something like this:

#gallery{
     float: left; 
     width:45%;
     margin:2.5%; 
     background-color:#5f5f5f;
     color:#bdc3c7; 
}

I hope it helped! (:

I spent 1 full hour trying to figure it out , thanks a lot : D !