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 How to Make a Website Creating HTML Content Structure the Image Gallery

Michael Gremillion
Michael Gremillion
948 Points

How come when I refresh the preview, the number 1 image doesn't appear, but shows a small icon instead of the image?

The photo itself is not showing up. Instead an icon suggesting a photo is there shows up. Meaning the code itself is correct? But the browser isn't recognizing the photo?

Hey Michael,

Try checking the file path for the image you're trying to display. If you're seeing an image icon, that means you've used the <img> tag correctly. Likely, the reason your image isn't display is you've either not set the src="" attribute, or the path within the src attribute is slightly off. This is what the src path would look like if your image is in the same folder as your HTML file. I've used .format in the examples, but that just represents whatever format your image is in. (i.e. .jpg, .png etc.

<img src="photo-name.format" alt=" Image 1 description"/>

If your images are stored in their own folder, and that folder is at the same level in the file structure as your HTML file, you'll need to enter the path that will tell the browser to look in that folder. I've pretended that the name of my image folder is img below.

<img src="img/photo-name.format" alt=" Image 1 description"/>

Hope that helps!

Michael Gremillion
Michael Gremillion
948 Points

Hey Ben,

Thanks for your help! After looking over the <img> tag I realized all of it was formatted correctly. However, when I looked at the "img" folder I realized I capitalized the "I" on the folder and not in the tag. I had no idea something that simple could throw off the code. Thanks again!

1 Answer

You bet! And yeah, you'll find case sensitivity and file path errors are some of the simple errors that keep your code from working. The good news is, once you know what common errors to look for, and can find them, they are really easy to fix. Good work, keep at it!