October 22, 2011

Linking to another Page within your Website

To link to another page within your website, there’s no need to insert the pound sign (#) before the file’s path, instead just place the filename and the appropriate file extension as the value of the hypertext reference (href). This method is applicable only if both webpages, the current page and the file to be linked to, is within the same folder. As shown in the right.

If you are creating a link on page1.html and you want to link on page3.html, make sure to include the directory or folder where page3.html is located, see the folder-file structure on the right side.
What if you are on page3.html and you want to create a link which will lead back to page1.html, what would be the value of href? Tricky eh? You have to tell the browser to go up one level in order to get page1.html. In this situation use the code below:

<a href=”../page1.html”>Page 1</a>


Cristine said...

I'm a not so "tech-y mom". It's my first time to come across this information. Thank you for posting. :)

JonaBQ said...

I do the easiest thing a non-techie blogger would do. I copy the link of the blog post and then I paste it to the anchor text in my new blog post. Hehe! Thanks for this useful info :)

Unknown said...

This is great. Useful for inserting more readable links to comments.

Aileen said...

Learning a lot here. I won't be able to remember this after a while...good thing I know where to look for the info i need---> here :-)