lime icon

Phosphorus and Lime

A Developer's Broadsheet

This blog has been deprecated. Please visit my new blog at klenwell.com/press.
HTML: relative links
Ok, how long have I been doing web design? And until this afternoon, if you would have asked me how to create a relative link to a file two directories up, I would have had to look it up or would have fiddled around with slashes and dots until it worked. The reason: I got started using Dreamweaver.

Anyway, I finally did look it up. The rule?

./ <- current directory. Handy if you want to link to the index page without to use something like 'index.html'

../ <- parent directory


source: webmasterworld.com

The other reason I never mastered this was I started working in PHP and was more concerned on creating relative links from a variable defined root level. In that case -- say where you move a site from a subdirectory on your local server to the root directory of a production server -- these kinds of links are not that handy.