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 trialJohn Holton
216 PointsImage Tag Question
I am stuck on this error. Bummer! Make sure you include an image tag that displays "img/numbers-01.jpg"
Code is:
<section>
<ul>
<li>
<a href="img/numbers-01.jpg">
<img src="img/numbers-01.jpg" alt="">
<p>test test1</p>
</a>
</li>
</ul>
Any help is appreciated. thanks
5 Answers
Dave McFarland
Treehouse TeacherJohn,
You don't need <a>
tags around the images. The <a>
tag is used to create a link to another page (or even an image). You don't use it to insert an image into page. You just need the <img>
tag to complete this challenge.
MEHMET SAGLAM
1,028 Pointsthank you
Adam East
2,424 PointsFor this you would need to create use
<img src="img/numbers-01.jpg">
You should also remember to always use an Alt tag for those that may not be able to visually see the image. :)
John Holton
216 PointsThe examples given in the video shows <img src="img/numbers-01.jpg">
. Do you leave off the = when identifying the image tag? Thanks
Dave McFarland
Treehouse TeacherNo, you need an = sign. I think Adam just missed it. I've updated his post to include the = sign.
John Holton
216 PointsSorry to be a pain but the example wants an anchor tag for the image. I have copied the code exactly as the video describes and still get the error. I am wondering if I need to download the images into the Challenge (if yes, how?)?
Dave McFarland
Treehouse TeacherHi John,
The code challenge says "donβt add any captions or links. Just the images!" (At least it says that in this code challenge: https://teamtreehouse.com/library/organize-with-unordered-lists. Are we talking about the same challenge?)
The challenge may be different than what Nick shows in the video.
John Holton
216 PointsThanks Dave. I will read the instructions closer next time.
Dave McFarland
Treehouse TeacherDave McFarland
Treehouse TeacherJohn,
Your HTML code wasn't showing up correctly. I fixed it in your post.
For the future, to put HTML/CSS/JavaScript in a forum post:
hit return to create a new line and type three back tick characters ```
hit return to create another new line and paste your HTML
hit return and add three more back tick characters: ``` The back tick character isn't the same as the single quote -- ' -- mark; the back tick is located on the same key as the ~ on most keyboards.
Also to add correct color highlighting add the name of the language after the back ticks like this: ```CSS. Here's what CSS should look like in a forum post: