Specify aboslute image path?

They have: 105 posts

Joined: Mar 2006

When does it make a difference as to whether you are using an absolute image path such as:

(note the below path is an example)

C:\program files\images\image2.png

as opposed to:

image2.png

I have images and html pages in the same directory, but sometimes (in firefox on different computers at different locations) it can't find the images when they are referenced as image2.png, but it can find them when they are referecned:

C:\program files\images\image2.png

demonhale's picture

He has: 3,278 posts

Joined: May 2005

because html pages needs the exact image links to find it, that's why it's best to have one project folder for every html project you have, that way even without the absolute path, it finds that image if it resides on the same folder...

calculator's picture

They have: 40 posts

Joined: Nov 2007

I would recommend to always use absolute path over relative that way it save you counting the number of folders you are in and the number of ../../../ you should be putting in your image path.

I would also advise you to ut all your images in a single place (a folder called images) making them easier to find.

That's the only thing you then need to remember to put an image on a page.

My final advise would be not to use .png files as not all browsers will display them.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.