Recipes for tasty webpages from
html.help.gnubee
Home of the MALLRATS
|
We all know what a URL is & how to read one. Now let's talk about using relative or "short" URL's in our pages. Let's say I'm making a sig for my email. I want to have a picture of a '34 Ford hot rod (a deuce coupe) from my images directory & I want to use "Little Deuce Coupe" by the Beach Boys from my midi directory for my music. My filename will be "duece_coupe.html". The URL for my sig would be But I could also use a shorter version of each URL that is "relative" to the directory I'm working in.
If I'm writing my page in my root directory, the files would be: images/34ford.jpg & midi/duece_coupe.mid & my code would simply be: A browser would already be at my Root directory reading my code. When it sees a relative URL, it knows to simply go straight to the the directories & grab those files. If I use absolute URL's, the browser goes back to the internet first & looks for my site, then the directories for each file. So using relative URL's saves on load time for individual files. It also saves time when you write your code & since there is less code, your page or sig will load faster.
Now let's say I keep all my sigs in their own "sig" directory (BTW, I do).
My directory tree would look like this: Root images 34ford.jpg midi duece_coupe.mid sig deuce_coupe.html This will change the relative URL's in my code since I am workig in a different directory. Before I simply went "down" to my "image" & "midi" directories. But since my page is now in my "sig" directory. I have to tell the browser to go "up" 1 directory level then "down" into the other directories.
How do I do that?
Here is my new code:
This tells the browser:
|