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 Include External CSS

Your images are not appearing in my preview screen

This is my code. And your images are sitting in my images folder.

<section>
        <ul>
          <li>
            <a href="img/numbers-01.jpg">
              <img src="img/numbers-01.jpg" alt="">
              <p>Experimentation with colour and texture.</p>
            </a>
          </li>
          <li>
            <a href="img/numbers-02.jpg">
              <img src="img/numbers-02.jpg" alt="">
              <p>Caption 2.</p>
            </a>
          </li>
          <li>
            <a href="img/numbers-06.jpg">
              <img src="img/numbers-06.jpg" alt="">
              <p>Caption 3.</p>
            </a>
          </li>
          <li>
            <a href="img/numbers-09.jpg">
              <img src="img/numbers-09.jpg" alt="">
              <p>Caption 4.</p>
            </a>
          </li>
          <li>
            <a href="img/numbers-12.jpg">
              <img src="img/numbers-12.jpg" alt="">
              <p>Caption 5.</p>
            </a>
          </li>
        </ul>
      </section>

Can you please post your code? I can't help you if I do not know what is going on in your code?

1 Answer

Lorenzo Pieri
Lorenzo Pieri
19,772 Points

Are you 100% that the images ARE in the Img folder and not outside of it? The difference visually is just about 2mm long, so it is easy to make the error.

Also, make sure your path for the images follows the right way!

<img src="img/myimage.png" alt="myimage" />  <!-- for relative path images with no up-folders call -->

<img src="../img/myimage.png" alt="myimage" /> <!-- for relative path images with up-folder call -->

Hope I helped. Have the best day!

same problem here, and my images are in the img folder and not outside, I tried running the workspaces output on three different browsers; IE, Chrome and Firefox, and the same issue on all of them, it shows the icon that there is an image there, but it won't show the image itself, obviously when you add the href and make it a link, when you click on it , the image is shown on another window correctly, but it won't show on the index.html, also I make sure index.html is outside the img folder.

Lorenzo Pieri
Lorenzo Pieri
19,772 Points

Would you mind making a full-screen screenshot so that I can check with my own eyes every little bit of code and settings? :)