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

General Discussion

loading images

I am trying to insert an image file into a web page. I placed my index file and images into the same folder and launched my index file into my browser. I then created an image tag but i only get an icon and not my jpg. Here is my code: img src="head 001.JPEG" /> I tried jpg also with the same result. head 001 is the name of my file. any help Paul

5 Answers

<img src="head001.jpeg" />

Change the name of the image to "head001" instead of "head 001".

You've got a space in there, take that out and it should work fine.

Thanks guys :) I tried that before and I just tried again but I am still getting the icon and no image. I have had this problem for a while; I tried when I was using code academy and also with treehouse??? I know I am doing something wrong but I can't figure out what. I created the index file moved it into a folder moved my photos jpgs into the same folder and then launched the index file from the folder into chrome no problem wrote the code saved refreshed page in chrome and no dice???

First of all you must specify the name of the image + prefix. Because tag <img src="head001.jpeg" /> is the way to go. But remember you must change the name to "head001.jpeg" also!

Thanks Harald, I copied and pasted your code and it still doesn't work. I can do everything but get an image file to load. Here is my work <!DOCTYPE html>

<html> <head>

<title> This is the title!</title> </head> <body> <img src="head001.jpeg" />

</body>

</html>

What is the name of the image?

head 001 I copied and pasted this so you could see the file name as it was originally named

Ok. The name must be the same as the name you have on the img-tag. Change the name of the image to "head001" instead of "head 001". If that doesn't work please tell me what kind of file it is (.jpg, .png, .gif, .jpeg etc.).

I renamed the file it is a JPEG and I put that in the code and it still didn't work??? really puzzled I have checked everything and I can do everything else and gthe index file and the photos are in the same folder the problem has to be there in the folder but I am not sure what it is lol

That's weird. Can you copy and paste your html file?

it won't let me paste it here I am off to work I will get back to you thanks

Ok I am really puzzled I have retried everything even creating a new project and new file new folder can some one list step by step how to create a web page I am using opera as my browser but I can use chrome if it is easier for someone to explain I know this is basic but there has to be something I am missing. I am using notepad++ but I also have sublime as well so if someone could take me from step 1 that would be awesome. Thank you for your time and energy. I can't let this hold me up it's driving me crazy lol :P