Html – How to link html pages in same or different folders

anchorhtml

How can I link to html pages if they are in same or different folders without writing full path?

Best Answer

Within the same folder, just use the file name:

<a href="thefile.html">my link</a>

Within the parent folder's directory:

<a href="../thefile.html">my link</a>

Within a sub-directory:

<a href="subdir/thefile.html">my link</a>