[thelist] Question of directory

Lachlan Cannon luminosity at members.evolt.org
Mon Apr 22 04:15:01 CDT 2002


\Daniel Medley\ said:
If you want to link bla.html to whatever.css,
> would you have it as such, <link rel=\"stylesheet\"
> href=\"../whatever.css\" type=\"text/css\" />? This works but it seems
> a bit cumbersom. Especially if I happen to have another
> sub-directory within my bla directory and wanted to link it to
> whatever.css. Would I then use, ../../whatever.css in my link tag, or
> is there another way to approach this that I\'m not aware of?

Just use a root relative address, that is href="/whatever.css". The web
browser automatically appends anything after a straight slash with nothing
before it onto the end of the domain. So a link to "/" is to the root, and
anything after the slash is relative to the root. So if you had your style
in a directory called /style/, you could then refer to it throughout your
site as "/style/whatever.css"

By the way, I do recommend making a seperate directory for styles and
images. It keeps your directories more ordered and neat, just like the
directories for html files do.

Lach





More information about the thelist mailing list