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 Add Image Gallery Content

james freyre
james freyre
526 Points

While building a website using HTML/CSS, images aren't appearing in the preview workspace. Only links. Any ideas why?

Btw, my code is exactly the same as in the video. I checked mutiple times. Also tried it on Chrome and Edge browsers.

This is my code so far btw. Thanks for all your help!

<!DOCTYPE html>
<html> 
  <head>
    <meta charset="utf-8">
    <title>James Freyre Designer</title>
  </head>
  <body>
    <header>
      <a href="index.html">
        <h1>James Freyre</h1>
        <h2>Designer</h2>
      <a/>
      <nav>
        <ul>
          <li><a href="index.html">Portfolio</a></li>
          <li><a href="About.html">About</a></li>
          <li><a href="Contact.html">Contact</a></li>
        </ul>  
      </nav>
    </header>
<section>
<ul>
  <li>
    <a href="img/numbers-01.jpg" alt=""
      <img src="img/numbers-01.jpg" alt="">
      <p>Experimentation with color and texture.</p>
    </a>
  </li>
    <li>
    <a href="img/numbers-02.jpg" alt=""
      <img src="img/numbers-02.jpg" alt="">
      <p>Playing with blending modes in photoshop.</p>
    </a>
  </li>
     <li>
    <a href="img/numbers-06.jpg" alt=""
      <img src="img/numbers-06.jpg" alt="">
      <p>Trying to create 80's style of glows.</p>
    </a>
  </li>
       <li>
    <a href="img/numbers-09.jpg" alt=""
      <img src="img/numbers-09.jpg" alt="">
      <p>Drips created using photoshop brushes</p>
    </a>
  </li>
      <li>
    <a href="img/numbers-12.jpg" alt=""
      <img src="img/numbers-12.jpg" alt="">
      <p>Creating shapes using repetition.</p>
    </a>
  </li>

</ul>
</section>    
<footer>
  <p>&copy;2017 James Freyre.</p>
</footer>    
  </body>  
</html>
Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,252 Points

Hi James, could you post the code you have for us? Maybe a second pair of eyes can help spot something! :-)

3 Answers

Rochell Hill
Rochell Hill
10,677 Points

You left off the '>' after the alt="" portion of some of your code.

Example of your code: <li> <a href="img/numbers-12.jpg" alt="" <img src="img/numbers-12.jpg" alt=""> <p>Creating shapes using repetition.</p> </a> </li>

Try this: <li> <a href="img/numbers-12.jpg" alt=""> <img src="img/numbers-12.jpg" alt=""> <p>Creating shapes using repetition.</p> </a> </li>

Nancy Melucci
PLUS
Nancy Melucci
Courses Plus Student 35,157 Points

I can't tell from this code exactly what is going on. I remember that workspaces usually requires the images to be in the images file path. Where are your images? Can the file see them? Are you using the correct extensions?

I am just spitballing here. If this has nothing to do with the problem, I apologize. Good luck!

james freyre
james freyre
526 Points

Thanks so much everybody. In addition to what Rochell noticed, my folder containing the images was titled "images" and not "img." I corrected it and all is okay now. So the following code (marked img) couldn't detect where the images were located. <a href="img/numbers-02.jpg"> <img src="img/numbers-02.jpg" alt="">