| [Index of Lessons] [Advanced Lesson 9] |
A10. Navigating Directories |
| Accessing files in different Directories The types of links we have constructed are known as "relative" links, meaning a web browser can construct the full URL based upon the current location of the HTML page and the link information in the <a href=...> tags. This is very powerful because you can build all your web pages on one computer, test them, and move them to another computer- all the relative links will stay intact. Now that you know how to construct a hyperlink to a document that is stored in the same directory as a working HTML page. It is time to learn that the HTML file can link to files that are either in a higher or lower directory. This is slightly more difficult than a link to a file in the same directory. For example, say you have the same directory structure as this :
To access the pictures from Root to UFO Pics the command <a href="/Images/UFO Pics/filename.gif"> would be used. Notice how the directory structure is mimicked within the quotation marks.This is how you access a directory lower than the document you are currently in. Now for a document in Paranormal documents to access a picture this would be done as : <a href="../../Images/Paranormal Pics/filename.gif"> Notice the difference, each instance of "../" the URL of an anchor link tells the web browser to go to a higher level directory/folder relative to the current page; in this case to go up two directory/folder levels (HTML documents and then into Root) and then down two directory/folder levels (Images and then Paranormal Pics). Depending on your system, the actual "/" could have to go this way "\". An example is that on my home system when I designed all of these web pages, I have all of the pages separated into different directories using the "\". The networked systems that I have placed these pages on (Win NT and FreeBSD Operating Systems) have required that the directory structure be accesed via the "/". Sometimes you learn from trying. Click here (Top) to return to the top of document. And thank you for viewing my work. I hope you enjoyed and learn't something here.
|
|||||||||||||