Prev | Current Page 223 | Next

Craig Grannell

"The Essential Guide to CSS and HTML Web Design"

evolt.org.
Never omit end tags when working with links. Omitting is not only
shoddy and invalid XHTML, but most browsers then turn all subsequent content
on the page into a link.
USING LINKS AND CREATING NAVIGATION
151
5
The index.html file name is preceded by ../, which tells the web browser to move up one
directory prior to looking for index.html. Moving in the other direction is done in the
same way as with absolute links: by preceding the file name with the path. Therefore, to
get from the homepage back to the instar.html page, you would write the following:
Instar lyrics
In some cases, you need to combine both methods. For instance, this website has HTML
documents in both the lyrics and reviews folders. To get from the instar.html lyrics
page to a review, you have to go up one level, and then down into the relevant directory
to locate the file:
Alloy review
Root-relative links
Root-relative links work in a similar way to absolute links, but from the root of the website.
These links begin with a forward slash, which tells the browser to start the path to the file
from the root of the current website. Therefore, regardless of how many directories deep
you are in the Wireviews website, a root-relative link to the homepage always looks
like this:
Homepage
And a link to the instar.html page within the lyrics directory always looks like this:
211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235