The a-tag is used to link pages together. Links are the new thing of www, and among other things gave name to one of the first browsers, Lynx. You can also make links internally on a page, e.g. from a table of contents to a chapter.
Here's an example:
<a href="divex.html">Link 1</a> <a href="divex.html#links">Link 2</a> <a href="#links">Link 3</a> <a name="links" />In the first case I have an ordinary link to an XHTML page. In the second case I link to a spot on this page. In the third case I do the same, but linking to a spot on the page where I am. Finally in the fourth case I define a spot, that might be linked to. In the first 3 cases there's a text within the tag (e.g. "Link 1") - this is a text, that will be shown in the browser underlined.
One of the extra attributes, that can be put on an a tag, is target. Here you can link between the windows or frames already there. If you link to a target, and the browser don't know what you mean, a new window will be opened.
Concept last updated: 06/05 2004.
- Beginning XHTML; Frank Boumphrey, CG, DR, JR, SS, TW - 4 Links and embedded objects - The <a> element
- Diverse opgaver - Links
- Diverse XHTML eksempler - Links
- The Web Wizard's Guide to Dreamweaver; James G. Lengel - Chapter 1, Introduction to Dreamweaver, Build a page with Dreamweaver, Link the pages