April 01, 2006

HTML - Linking within a page

Earlier, I was wondering how do I link to an article that requires scrolling down to middle of the page. The below answer is being borrowed from this site.


To link to a specific section in a page, you need to place
<A NAME="section_name"></A> tags at the beginning of the section you will be linking to (section_name = a unique name for each
section of a page).

Then to link to that section from within the same document, use the
anchor tag:
<A HREF="#section_name"> text to be linked
</a>


To link to this section from another page, add #section_name to the end of the url of the
page, i.e. http://server_name/path/filename.html#section_name.

0 Comments: