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 trialHamzah Iqbal
Courses Plus Student 2,529 PointsVery 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
15,622 PointsYou are mixing two tags, a and img.
Try
<img src="img/numbers-01.jpg" alt="">
and do the same to the rest.
Sreng Hong
15,083 PointsYou 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
Courses Plus Student 2,529 PointsAwesome, thanks guys. Could you tell why you dont use the anchor?
Hugo Paz
15,622 PointsYou 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
15,083 PointsCorrect me if i'm wrong, but I think this link won't work without http://
before www.google.com
.
Hamzah Iqbal
Courses Plus Student 2,529 PointsThanks man :)