![]() |
Tutorials
| Workshop
| Troubleshooting
|
Linking
Links to Specific SectionsAnchors can also be used to move a reader to a particular section in a document (either the same or a different document) rather than to the top, which is the default. This type of an anchor is commonly called a named anchor because to create the links, you insert HTML names within the document. This guide is a good example of using named anchors in one document. The guide is constructed as one document to make printing easier. But as one (long) document, it can be time-consuming to move through when all you really want to know about is one bit of information about HTML. Internal hyperlinks are used to create a "table of contents" at the top of this document. These hyperlinks move you from one location in the document to another location in the same document. You can also link to a specific section in another document. That information is presented first because understanding that helps you understand linking within one document. Links Between Sections of Different DocumentsSuppose you want to set a link from document A (documentA.html) to a specific section in another document (abc.html). Enter the HTML coding for a link to a named anchor: documentA.html: In addition to the many state parks, Maine is also home to <a href="abc.html">test page</a>.Think of the characters after the hash (#) mark as a tab within the abc.html file. This tab tells your browser what should be displayed at the top of the window when the link is activated. In other words, the first line in your browser window should be the Acadia National Park heading. Next, create the named anchor (in this example "Intro") in abc.html: <H2><A NAME="Intro">Introduction</a></H2>With both of these elements in place, you can bring a reader directly to the Introduction reference in abc.html. NOTE: You cannot make links to specific sections within a different document unless either you have write permission to the coded source of that document or that document already contains in-document named anchors. Links to Specific Sections within the Current DocumentThe technique is the same except the filename is omitted. For example, to link to the ANP anchor from within abc, enter: ...More information about <A HREF="">Introduction</a> is available elsewhere in this document.Be sure to include the <A NAME=> tag at the place in your document where you want the link to jump to (<A NAME="Intro">Introduction</a>). Named anchors are particularly useful when you think readers will print a document in its entirety or when you have a lot of short information you want to place online in one file. |
||||||||||
|