Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML How to Make a Website Creating HTML Content Add Image Gallery Content

Whitney Mitchell
Whitney Mitchell
2,154 Points

Images appear on page, but clicking images takes me to an error page.

Hello! I'm having trouble making my img links work. As far as I can tell, the code is right. But when viewing the img gallery, if I click on a photo it takes me to a 404 Error screen, as opposed to a page with just that img. Here's a snapshot of my code: https://w.trhou.se/gk6kv9gpvg Any insight would be appreciated! Thanks!

3 Answers

Henrik Christensen
seal-mask
.a{fill-rule:evenodd;}techdegree
Henrik Christensen
Python Web Development Techdegree Student 38,322 Points
<a href="img/number-02.jpg">
            <img src="img/numbers-02.jpg" alt="">

In your <a> you are writing ....img/number.... In your <img> you are writing ....img/numbers...

I think it should be either "number" or "numbers" ;-)

Whitney Mitchell
Whitney Mitchell
2,154 Points

Henrik, Thank you so much for spotting that! Theoretically, adding an s a few times fixes everything. However, when I click on an image in the browser I'm still getting the same error message. I noticed the URL at the top doesn't reflect the code I changed (adding an s), and when I simply add an s to the word number in the web address itself, it works fine. So I think the problem is that that browser isn't recognizing the changes I made. New snapshot, in case I'm missing something else. https://w.trhou.se/lkcpqsmus1

Thanks!

Whitney Mitchell
Whitney Mitchell
2,154 Points

Okay, so, I just gave it an hour, refreshed the preview page, and now everything works. Thanks for your help! A second set of eyes on this stuff is invaluable sometimes!