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 Structure the Image Gallery

Kristina Millikan
Kristina Millikan
588 Points

Image not loading in browser

Hello Treehouse community,

I am having the same issue as several previous users in that the browser is displaying an image icon, rather than the image itself. I've tried in three separate browsers (firefox, microsoft edge, and google chrome), and I tried adding the ../ before the file name, and none of it is working. Here is my code for reference:

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

Tried <img src="../img/numbers-01.jpg" alt=""> as well. Please clue me in to what I'm doing wrong so I can move forward with the lesson.

Thank you!

nico dev
nico dev
20,364 Points

Hi Kristina,

Did you assign the id "gallery" to the ul?

By the way, if you paste code here in the forum, it's easier to read this way: type three times the key under ESC on your keyboard, then type Enter, starting on the next line type/paste your code. Finally, when you finish with your code, type Enter again, and in the next line type again three times the key under ESC on your keyboard.

<section>
        <ul id="gallery">
          <li>
            <a href="img/numbers-01.jpg">
              <img src="img/numbers-01.jpg" alt="">
              <p>Experimentation with color and texture.</p>
            </a>
          </li>

Did that help?

1 Answer

Mark Lawson
Mark Lawson
6,148 Points

Did you follow the instructions about dragging the images into the workspace? Have you named the folder img and placed the images into the folder? If you have done this correctly your code should be <img src="img/numbers-01.jpg" alt="">.

Kristina Millikan
Kristina Millikan
588 Points

Thank you! I named the folder images instead of img and I didn't make that connection, lol. Much obliged.