Links in HTML

A link in HTML is a reference to another location a user can jump to. The common syntax for a HTML link is

<a href="URI">link text</a>

Link types

Link types are reflected by the type of uniform resource identifier (URI) of attribute href . The following formats for an URI are possible

1. anchor in the same document (e.g. #anchorname)
2. other document (e.g. myDoc.htm)
3. other document in other directory (e.g. ../directory/myDoc.htm)
4. anchor in other document (e.g. myDoc.htm#anchorname)
5. anchor in other document in other directory (e.g. ../directory/myDoc.htm#anchorname)
6. WWW address (https://... )
7. address to local document ( file://...)
8. Gopher address ( gopher://...)
9. FTP address (ftp://... )
10. Telnet address ( telnet://...)
11. Newsgroup address ( news:...)
12. E-Mail address ( mailto:name@domain.xy)

Link types 1 to 5 above can be summarized as links with relative addresses (i.e. relative to the location the document containing the link is stored), all others work with absolute link addresses. Instead of a link text an image can be specified as well, for instance

<a href="home.htm">

<img src="anImageFile.jpg" width="160" height="34" border="0">

</a>

SimplyHTML models all types of links and supports links of type 1 to 7 above.

Link anchors

As shown in link types 1, 4 and 5 above, links not only refer to other files, they can point to specific locations inside a given file too. To enable a link to point to a certain location inside a file, so called link anchors have to be defined as target locations in respective target files. Link anchors are defined by inserting HTML code such as

<a name="anchorname">link anchor text</a>

Link anchors can be defined with or without an anchor text, however SimplyHTML only allows to create link anchors with text.