Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML How to Make a Website Creating HTML Content Add Image Gallery Content

No images

I think I have the same code as Nick, but no image shows up when I refresh and preview the page. I uploaded the images to my workspace and put them in a folder labeled img. What am I doing wrong?

<section> <ul> <li> <a href="img/numbers-01.jpg"> <img scr="img/numbers-01.jpg" alt=""> <p>Experimentation with color and texture.</p> </a> </li> </ul> </section>

2 Answers

Well just make sure about a few things first
Lets assume you are creating your html project in a folder called Demo and you have your main html file called main.html in the same folder demo.
In the same folder you have your image file called image.jpg
So to call your image i.e. image.jpg in your main.html file you will use the tag

<img src="image.jpg" alt="alt_text" />

If you have your image files in a subfolder called images inside your Demo folder then you will refer to the image as given below. Subsequently add the preceding parent folders name in front of the child, followed by a forward slash / if your image files are two or three folders deep

<img src="images/image.jpg" alt="alt_text" />

// OR if your images are stored in a deeper level of folder structure then use this notation
<img src="parent_folder/child_folder/images/image.jpg" alt="alt_text" />

Try looking into your html code too. Maybe you spelt something wrong (it is case sensitive) or forgot to close the tags.
If it still doesn't work you can post your code here so that we can look into it.
Hope it helps

Thanks. I had scr instead of src. It took being away from it for a few days to look at it again for me to find that error.

Jason Montoya
Jason Montoya
6,550 Points

Peter try this:

./imagefolder/filename.jpg"

Your file path to the image is incorrect somehow. Here is a link to some good content about file paths if this didn't help

http://css-tricks.com/quick-reminder-about-file-paths/

Hope this helps. Cheers