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

Sam Hardy
Sam Hardy
524 Points

So I seem to be having an issue with no matter which file I choose the picture won't appear in my web page.

I will post the line and code that I used and the name of the image

<img src="img/Batman-Wallpaper-3.jpg" alt="">

3 Answers

Duncan Casey
Duncan Casey
391 Points

I was having the same problem Sam, but I had dragged the index.html file into the new img folder, which was causing the error. Drag it back out of the img folder and it will work properly.

Sam Hardy
Sam Hardy
524 Points

I had my image in the wrong folder lol! Ooopsss. Thank you everybody for the help

Mike Hickman
Mike Hickman
19,817 Points

The actual code is right, so I would double-check (and triple-check) a couple things:

  • Is the file name the EXACT same (including the extension..is jpg uppercase/lowercase in the file name?)
  • Is the img folder in the same main directory of your html page?
  • Make sure the image was uploaded into the img directory instead of it accidentally getting put somewhere else

Hard to help other than that without seeing the whole setup.

Good luck!

Sam Hardy
Sam Hardy
524 Points

Thanks Mike!

Mike Hickman i was experiencing the same problem, but when i double checked my code i found the image file name was wrong.

Fuad B
Fuad B
458 Points

Good explanation Mike, I'll add 2 cents here: also make sure to check the img folder is named img only, and not img.html thinking that might be an html file like the index.html file instead of a folder which should be named only img. good luck!