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

Clicking on Image does not open it up in its own tab.

My images show up on my preview, but when I click on one to open in its own window/tab - I get this: Not Found

The requested URL /numbers-01.jpg was not found on this server.

4 Answers

Make sure you're nesting the img element inside anchor tags and that the href attribute has the correct relative path to the image.

<a href="img/numbers-01.jpg">
  <img src="img/numbers-01.jpg" alt="Number one">
</a>
Roy Penrod
Roy Penrod
19,810 Points

If you want it to open up in a new window, you also need to add the target attribute to the anchor element. The code looks like this:

<a href="img/numbers-01.jpg" target="_blank">
  <img src="img/numbers-01.jpg" alt="Number one">
</a>

I had the same issue. Mine was due to me mistakenly spelling out the word image inside of the href attribute instead of using the "img" property. Double check for potential grammatical errors.

This was my incorrect format:
<a href="image/numbers-01.jpg">
  <img src="img/numbers-01.jpg" alt="">
</a>
It should be:
<a href="img/numbers-01.jpg">
  <img src="img/numbers-01.jpg" alt="">
</a>

Thank you all! Sometimes it is the simplest error!