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 Build a Simple Website Text Editors and HTML Images and Lists

Keaton Herzer
Keaton Herzer
6,361 Points

Image not displaying

I entered the code into Sublime 2 the exact way he does it in the video and when I open the file in Google Chrome, the image does not display. There is a small icon where the image should be that I think means the computer knows there is supposed to be an image there but for whatever reason cannot load the image properly. Any suggestions on how to fix this?

10 Answers

Is there's a website folder in your directory. ?? Where exactly you have imdex.html saved ? Make sure you save the image folder/image into the same one. And direct to that directory after src.

Keaton Herzer
Keaton Herzer
6,361 Points

OK I see where I made the mistake. Thanks a lot for the help!

Keaton,

It looks like you are trying to use a relative root path. If so you need to put a forward slash / in front of documents.

<img src="/documents/websites/img/logo.gif">

Jeff

Make sure you enter the image directory properly where the image is located in your system and folder not like in video they might have it at different directory than you.

Make sure you enter the image directory properly where the image is located in your system and folder not like in video they might have it at different directory than you.

Keaton Herzer
Keaton Herzer
6,361 Points

I'm using a Mac and the "img" folder I downloaded is in a folder within my "documents" folder. Should I move it to another spot?

Keaton Herzer
Keaton Herzer
6,361 Points

I'm using a Mac and the "img" folder I downloaded is in a folder within my "documents" folder. Should I move it to another spot?

Keaton Herzer
Keaton Herzer
6,361 Points

I'm using a Mac and the "img" folder I downloaded is in a folder within my "documents" folder. Should I move it to another spot?

Move the image into same folder as you have your html document and then select <img src( means source, where the file is located and insert the exact location where you have the image file)

Hi Keaton,

It would help to see the code. But I'm going to guess that the image is not located where the html code is pointing. And/or the wrong image name is being supplied.

Jeff

Keaton Herzer
Keaton Herzer
6,361 Points

I took some of the above suggestions and it's still not displaying. Here is the code I typed:

<!DOCTYPE HTML> <html> <meta http-equiv="Content-Type" content="text/html"; charset=utf-8"/>

<head> <title> Smells Like Bakin' Cupcake Company </title> </head> <body> <img src="documents/websites/img/logo.gif" alt="Smells Like Bakin">

</body> </html>

Keaton Herzer
Keaton Herzer
6,361 Points

I guess it doesn't display if I copy and paste the code. Sorry about that. Let's see if this will show up:

img src="documents/websites/img/logo.gif" --- with arrow brackets

Keaton Herzer
Keaton Herzer
6,361 Points

Here is the code. Sorry. Thanks for the help!

<img src="documents/websites/img/logo.gif" alt="Smells Like Bakin">

Is there's a website folder in your directory. ?? Where exactly you have imdex.html saved ? Make sure you save the image folder/image into the same one. And direct to that directory after src.

Rory Costello
Rory Costello
4,109 Points

Very helpful - thanks all!