Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Internal Links

  • So how do you create a link that points to a location inside of a document?

  • Just as we did when we were creating links to another web page, we will use the anchor tag with an HREF attribute. However, rather than setting the HREF value to a simple URL, we will define a location within a page to link to.

  • An "internal anchor" uses a number sign and an internal page keyword to define a location. It looks something like this...
<A HREF = "#top">Go to the top of this page</A>

  • Of course, how does the web browser know what "#top" means?

  • Well, we have to let it know with HTML code. Specifically, we will provide an anchor to link to by using the NAME attribute in the anchor tag.

  • The NAME attribute defines a location within a page. Thus, for example, if we wanted the internal anchor in the previous example to work, we would need to put the following anchor at the actual top of the document with the internal link:

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

  • Try it out, by clicking here. We have included the example code in this very document.

  • Of course, you are not limited to linking from one part of a page to another. You can also link to a part of another page by including a URL within the HREF attribute. For example, the following anchor tag would link to the bottom of the page at http://www.eeye.com.sg/index.html:
<A HREF = "http://www.eeye.com.sg/index.html#bottom">
click here</A>

Additional Resources

Link Basics
Introduction to Web Design | Table of Contents
Email Links


Up to => Home / Authoring / HTML / Tutorial




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers