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 Creating HTML Content Organize with Unordered Lists

Hamzah Iqbal
PLUS
Hamzah Iqbal
Courses Plus Student 2,529 Points

Very basic: Inside the three new list items, add the following images from inside the img folder: "numbers-01.jpg"

I have the following code

<ul>

  <li>
    <a img src= "img/numbers-01.jpg" alt= "" >
    </a> 
  </li>


  <li>
      <a img src= "img/numbers-02.jpg" alt= "" >
    </a> 
  </li>

  <li>
     <a img src= "img/numbers-06.jpg" alt= "" >
    </a> 
  </li>

  </ul>

I just can't seem to get it to work. What am i doing wrong here?

Thanks beforehand.

4 Answers

Hugo Paz
Hugo Paz
15,622 Points

You are mixing two tags, a and img.

Try

 <img src="img/numbers-01.jpg" alt=""> 

and do the same to the rest.

Sreng Hong
Sreng Hong
15,083 Points

You write a wrong codes on anchor and image tags.

It should be like this:

<ul>
  <li>
    <a href="#"> 
      <img src="img/numbers-01.jpg" alt="">
    </a> 
  </li>
</ul>
Hamzah Iqbal
PLUS
Hamzah Iqbal
Courses Plus Student 2,529 Points

Awesome, thanks guys. Could you tell why you dont use the anchor?

Hugo Paz
Hugo Paz
15,622 Points

You mostly use anchors to create links like this

<a href="www.google.com">google</a>

Since you just want to display an image, there's no need for an anchor.

Sreng Hong
Sreng Hong
15,083 Points

Correct me if i'm wrong, but I think this link won't work without http:// before www.google.com.