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

Joshua Holland
Joshua Holland
2,865 Points

issues adding image tags

I'm having issues adding image tags for my challenge. I created the unordered list and list items with no issues. Then when I add the image tags I'm getting an error. Just to double check, I compared my challenge tags to the ones I created in my follow along workplace they look identical. To test even further, I copied/pasted from my workplace and they still don't work for the challenge. What am I missing?!

Edit when I click preview in the challenge screen, the image is appearing correctly in the preview. My challenge is posted down below. I only copied one example since I am just copy/pasting the code for the other two and editing the numbers.

Inside the three new list items, add the following images from inside the img folder: "numbers-01.jpg", "numbers-02.jpg", and "numbers-06.jpg". Leave the alt attributes blank, and don’t add any captions or links. Just the images!

        <li>
          <a href="img/numbers-01.jpg"</a>
          <img src="img/numbers-01.jpg" alt="">
        </li>
Eric Martz
Eric Martz
16,007 Points

Josh,

Below is a link describing how to post code to the forum. The short answer is to use three ticks in a row (`) to indicate where the code starts, and then three ticks to indicate where the code ends.

The tick mark should be in the upper left corner of your keyboard. It's the same key as for the tilde (~). Only reason I point it out is that it took me forever to figure out where it was.

https://teamtreehouse.com/forum/posting-code-to-the-forum

Joshua Holland
Joshua Holland
2,865 Points

Thanks Eric! I'm sure having that code in there will help me get a helpful answer to my question.

2 Answers

Sage Elliott
Sage Elliott
30,003 Points

Hello, Joshua. Your code is perfectly fine, but the quiz says: "Leave the alt attributes blank, and don’t add any captions or links. Just the images!" Delete all the the a attributes, and you will be fine! You're linking to the images! Example of one list item:

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

Simple misunderstanding. I believe I made the same mistake as well!

happy coding!

Joshua Holland
Joshua Holland
2,865 Points

That was it! thanks! so i was trying to add the pictures AND a link to them when I only needed the picture? Got it. Thanks so much everyone for your help!

Wayne Priestley
Wayne Priestley
19,579 Points

Hey Joshua,

You almost have it, just need to move the </a>

<li>
          <a href="img/numbers-01.jpg">
          <img src="img/numbers-01.jpg" alt=""> 
          </a>
</li>
Joshua Holland
Joshua Holland
2,865 Points

Okay so I moved the anchor where you suggest and I'm still unable to pass the challenge. This is what my code now looks like

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

And I am recieving the error "Bummer! Make sure you include an image tag that displays "img/numbers-01.jpg" This whole code that I'm typing is considered the "image tag" isn't it?