HTML Paths Dot Dot Slash Notation Directory folder Hierarchy We can think of a computers file structure as a tree with branches The trunk of the tree is the root folder It is the parent of all branches that connect directly to the trunk These child branches can themselves be pare ID: 403977
Download Presentation The PPT/PDF document "ET710" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
ET710
HTML Paths: Dot
Dot
Slash NotationSlide2
Directory (folder) Hierarchy.
We can think of a computer’s file structure as a tree with branches. The trunk of the tree is the root folder. It is the parent of all branches that connect directly to the trunk. These child branches can themselves be parents to other branches and so on and so on.Slide3
Links to child folders and files
A relative link can be used to link together all the files within a website
. If your directory structure looks something like the one at the right, a relative link can be written from index.html to any file in the root directory (
genealogy_html
), or any of the subdirectories in that directory: a href="aboutme.htm" a href="documents/obituaries.html" a href="families/brown/surnames.html”:Slide4
Links to parent folders and files
Dot-Dot-Slash
Dot-dot-slash tells the browser to move one level back toward the root directory before looking for the path to the file. To link from obituaries.html to index.html, the browser must move up one level from
documents
to
genealogy_html to find the file. The relative link is written like this: a href="../index.html" Slide5
Links to parent folders and files
Dot-Dot-Slash
Dot-dot-slash tells the browser to move one level back toward the root directory before looking for the path to the file. To link from obituaries.html to index.html, the browser must move up one level from
documents
to
genealogy_html to find the file. The relative link is written like this: a href="../index.html" Slide6
Links to parent folders and files
Dot-Dot-Slash
You can write a relative link from one subdirectory to another. To link from
brown/surnames.html
to
jones/surnames.html, the browser must move back one level to the families directory to find the jones directory: a href="../jones/surnames.html“. Slide7
Links to parent folders and files
Dot-Dot-Slash
Need to move back two directory levels? No problem. From
"
jones
/surnames.html" back through families to your home page in genealogy_html: a href="../../index.html" Just add one dot-dot-slash for every directory level you need to move back, until you find the path to the file. Slide8
Quiz (for the advanced)
Need to make
a link from
jones
/surnames.html to documents/obituaries.html ?
Look carefully.You need to go up one level to families, and then up another level to genealogy_html and then down one level to documents/obituaries.com.Write down the path before turning to the last slide which has the answer ---> Slide9
End
Need to make
a link from
jones
/surnames.html to documents/obituaries.html ?
../../documents/obituaries.html