FRIHOSTFORUMSFAQTOSBLOGSDIRECTORY
You are invited to Log in or Register a Frihost Account!

Relative URL, referring to uplevel directory

 


Crinoid
Sorry for basic question, still can't find an answer - may be you can help.

1. When using relative url, with reference to the image file located in the SAME directory, as a source file, then only a file name is used: =image.jpg

2. When using the relative url, referring to the image file that is located in SUBdirectory (in relation to the source file), then the name of subdirectory/filename is used: = images/image.jpg

3. But is it possible to refer to the UPlevel directory?

For example, the directory with index.html contains folders "css" and "images", and a folder (subdirectory) "fish" with fish.html file. The template used for a fish.html and index.html files is the same, it should contain reference to the "css" and "images" folders.

I couldn't find how to do that, and so far made duplicates of these two folders and placed them in the same directory with fish.html.
Is there a way just to make a reference to the upper directory, instead of duplicating the folders' content?

Thank you.
rvec
to go up a dir use ../ and to go up 2 dirs use ../../

In your example:
../css/style.css
../images/banner.jpg
alalex
Also if you are confused you can use Absolute directory, and reference the file or folder from the root, to do so just start with a "/" and then the full dir Wink

Sometimes is safer to go this way, sometimes is worse, just look at your case and decide which
Crinoid
Thank you very much - it's just what I wanted to know.
Reply to topic    Frihost Forum Index -> Scripting -> Html, CSS and Javascript

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2007 Frihost, forums powered by phpBB.