How to create links to sections on the same page in HTML

To create links to a link within the page, two HTML tags need to be used.

<A HREF="#top">Top</A>

This first tag is almost the same as any other HTML tag you would use to create a link to another page. However, to create a bookmark, you must start the link with a # (pound symbol,) which represents a name statement, used in the next tag. When the user clicks on Top, the computer would then go to the name tag, if found on the same page of the link

<A NAME="top"></A>

This next tag is where the first tag will go when the link is clicked. These are commonly referred to as bookmark and anchor.

Tip: Today, all browsers recognize top as being the top of the page, if you want the visitor to go to the very top of the page the above tag can be left out and the A HREF link created earlier will still work.

<A HREF="http://www.computerhope.com/issues/chsafe.htm#02">Windows 2000 Safe Mode</a>

Finally, a link can contain a web page with a bookmark that is on that page. In the above example, this code would create a link to our Safe Mode page and automatically move down to the Windows 2000 Safe Mode section.

Example

In this first example, clicking on the "Top" link will scroll your browser to the top of this page.

Top

In the next example, clicking on the "Windows 2000 Safe Mode" link will first open our Safe Mode page and then automatically scroll down to the Windows 2000 Safe Mode steps.

Windows 2000 Safe Mode

Additional information

  • See our hyperlink definition for further information and related links to this term.