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

james mchugh
james mchugh
6,234 Points

I'm try to load images to a practice website using workspaces.

It appears I'm using the wrong file path possibly. I've tried the direct path. The folder is named images and the image is names sunsetCity. I've actually have 5 images and have tried a few different paths. For example images/sunsetCity and ../images/sunsetOcean and ../../images/durianOpen, but none of my images will load to the webpage. I uploaded the images from my Macbook directly to the workspace then made a folder called images This is a link to a snapshot of my workspace http://w.trhou.se/g351z4rddn

Thanks,

James

By the look of your screenshot the name of your image is IMG_sunsetCity.jpg. See if this works:

<img src="images/IMG_sunsetCity.jpg" alt="Sunset">

4 Answers

james mchugh
james mchugh
6,234 Points

I was using curly quotations on my textEdit. If you use mac this may be a problem for you. To change your quotations to programmer quotations click apple in the top left > the system preferences > keyboard > select text on the top > uncheck the use smart quotes and dashes tab.

Agnes Demes
Agnes Demes
6,613 Points

Hi , the ../ would be a good example to use if the index.htm file was located in another folder such as folder HTML but in this scenario only the images are in a separate folder. You almost there only that the Image name defined as IMG_ before every image therefore it is part of its name.

"images/IMG_nameofimage.Jpg"

james mchugh
james mchugh
6,234 Points

I tried that also, I'll try it again. I made a simple site w/ a image of my fiancee I'm gonna look at the path of that also.

Agnes Demes
Agnes Demes
6,613 Points

I've just checked your file and it is still coded as

<img src= β€œimages/sunsetCity.jpg” alt="My test image"> instead of <img src= β€œimages/IMG_sunsetCity.jpg” alt="My test image">

james mchugh
james mchugh
6,234 Points

yeah I tried "images/IMG_sunsetCity.jpg" and it didn't load, so then I removed the IMG_ from every image file and it still won't load my photos to the webpage.

Agnes Demes
Agnes Demes
6,613 Points

hhmmm can you please post a new link with the latest solution. Also sometimes its a good idea to relaunch the project preview as browser can be slower to catch up.

james mchugh
james mchugh
6,234 Points

Ok Thank you I'll do that right now

james mchugh
james mchugh
6,234 Points

I just tried on the Chrome browser also, and it's not working there either.

james mchugh
james mchugh
6,234 Points

Agnes, Thanks for your help yesterday. I really appreciate it.