Basic HTML - how to set relative path to current folder?

serg picture serg · Nov 17, 2008 · Viewed 326.6k times · Source

Lets say I am currently at: http://example.com/folder/page.html

Is it possible to create a relative link on this page that points to http://example.com/folder/ without specifying folder anywhere? (And using only HTML.)

UPDATE: As it turned out ./ works only in non-strict doctype mode, while . works in both modes, so it is still a better answer in my opinion :) Thanks everybody.

Answer

MrChrister picture MrChrister · Nov 17, 2008

Just dot is working. The doctype makes a difference however as sometimes the ./ is fine as well.

<a href=".">Link to this folder</a>