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

Image problems

I am using the sublime text editor on my mac. I have a folder on my desktop where my index.html file is as well as my img folder. Now when trying to utilize the img src html code I using the name of the folder as such img/logo.gif which the image is in folder img and the name of the image is logo.gif. Nothing shows up except an empty box when I save and refresh my browser.I am following the instructions in the video but this is not making any sense. If I find a picture on the web and utilize that address it shows up fine. Please help

3 Answers

James Barnett
James Barnett
39,199 Points

@David -

The 2 most common mistakes when images are not showing up are a typo with the file names and using the wrong file path.

So triple check that you are using the exact name of the image files in your HTML, if that doesn't resolve the issue, check the file paths.

Here's a quick primer on file paths that should get you going.

Let us know how you are getting along with this here in this thread.

@David -

Instead of refreshing your browser, locate the index.html file through "finder" and double click on it. It should open up in your browser. Do the image files show now?

I had a similar problem the other day, with both images and CSS. In my case, it was a problem with how my root directory was ordered. My paths were correct, and for the life of me I couldn't figure out what the problem was.

When I went into "finder," the folder which "index.html" was located in and double clicked it, it opened in my browser and worked fine. I was able to make changes with my text editor, and just refresh the page that I had opened.

Hope this helps!

I figured it out. I had the image folder separate from where the index.html file was. Once I placed them in the same folder it worked like a charm. I'm a rookie to all this so thanks to all for helping me.