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 trialKeaton Herzer
6,361 PointsImage 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
Muhammad Javed
3,979 PointsIs 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.
Jeff Busch
19,287 PointsKeaton,
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
Muhammad Javed
3,979 PointsMake 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.
Muhammad Javed
3,979 PointsMake 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
6,361 PointsI'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
6,361 PointsI'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
6,361 PointsI'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?
Muhammad Javed
3,979 PointsMove 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)
Jeff Busch
19,287 PointsHi 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
6,361 PointsI 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
6,361 PointsI 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
6,361 PointsHere is the code. Sorry. Thanks for the help!
<img src="documents/websites/img/logo.gif" alt="Smells Like Bakin">
Muhammad Javed
3,979 PointsIs 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
4,109 PointsVery helpful - thanks all!
Keaton Herzer
6,361 PointsKeaton Herzer
6,361 PointsOK I see where I made the mistake. Thanks a lot for the help!