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

How to find an image url that is located on a host server?

Here's where I am stuck. I'm using Brackets to write my CSS and I want to include an image I uploaded to my Arvixe host server as a background image... but when I do the preview on chrome I get a 404 file not found (using the Chrome dev tool). To find out the url I used Cyberduck by right clicking on the image and showing it's url but that url is not displaying the image. I also copied the link directly from the file directory in my hosting control panel (via right click "copy link address")... this resulted in a different error "resource interpreted as image but transferred with MIME".

Trying to simply load the image from my own hard drive results in "not allowed to load local resource".

What am I doing wrong?

1 Answer

This is a little bit difficult to explain (at least for me) without knowing how your file structure looks, but I'll give it a go. The simplest way is if you have your .html files in the root directory, together with your img (image) folder. If you do, you simply use "img/[your_file_name_and_extention]" in the src attribute (this will make the browser look for the picture in "[address_to_your_root_folder]/img").

On the other hand, if you have your pages in a folder that is in the same folder as your image folder, you would use "../img". The ".." makes the search jump down one step in the hierarchy.

I hope this helps ^^