Hyperlinks within an HTML-page
This
kind of hyperlinks is often referred to as "anchors". Anchors
are used to move the focus quickly to another location within the same
page. This method of linking is especially useful to provide guidance
in pages with large amounts of text, that do not fit on the screen size
of the monitor. The link appears in the browser as any other link: with
coloured font and/or underlined. Click here
to follow an anchor link. The HTML-code for this anchor looks like:
<a href="#anchorname">here</a>
whereas the destination of the link is coded as:
<a name="anchorname">This</a>
The "anchorname" (which can have any desired name) provides
a unique identifier for the anchor-link.
Hyperlinks to other HTML-pages
The
HTML-code for an hyperlink to another HTML-page is not very different
from the code for an anchor:
<a href="http://www.lovely.nl/page1.html">
word from main text</a>
This
code can be placed around any selected block of text or an image. An important
remark is made here to distinguish between relative and absolute links.
An absolute link defines the complete URL-address of the destination page.
After moving the directory to another location, such a destination page
will not be reachable again. With a relative definition (with respect
to the location of the source page) the danger of "broken links"
is less:
|
source page |
destination page |
absolute |
http://www.lovely.nl/
page1.html |
http://www.lovely.nl/
text/page2.html |
relative |
page1.html |
/text/page2.html |
|