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

Image 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

Dave McFarland
Dave McFarland
Treehouse Teacher

John,

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:

  1. hit return to create a new line and type three back tick characters ```

  2. hit return to create another new line and paste your HTML

  3. 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:

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

5 Answers

Dave McFarland
STAFF
Dave McFarland
Treehouse Teacher

John,

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.

thank you

For 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. :)

The 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
Dave McFarland
Treehouse Teacher

No, you need an = sign. I think Adam just missed it. I've updated his post to include the = sign.

Sorry 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
Dave McFarland
Treehouse Teacher

Hi 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.

Thanks Dave. I will read the instructions closer next time.