PDA

View Full Version : Define Site Root and relative Path


wolfmanbc
11-28-2008, 03:46 PM
I need to link my images by relative path, but im not sure how to do it. I think I need to start by having a root folder, right? I built my first site but i never defined a root folder, how can i do this now that the site is complete?

coloeagle
11-28-2008, 04:24 PM
The root folder is the main/opening section of your website. This is where you would have your index/main page.
Example;
www.examplesite.com/index.html

Relative path is the path into folders required to obtain the page or image.
Example to obtain an image inside a first level folder;
www.examplesite.com/images/myimage.jpg
To obtain an image inside a second level folder;
www.examplesite.com/folderone/images/myimage.jpg

wolfmanbc
11-28-2008, 04:38 PM
a friend told me that i could do it using this code:

<href img../images/myimage.jpeg>

Is that right? something to do with the dots meaning "folder above"

coloeagle
11-28-2008, 05:05 PM
To call an image for display in a page it should be coded as <img src="pathtofolder/image.jpg" />Each ../ will move you back one folder/level

coloeagle
11-28-2008, 05:18 PM
For a full and proper image call tag you need to have the width, height and an alt tag.<img src="pathtoimage/image.jpg" width="???" height="???" alt="Image description" />