Linking in HTML
Introduction into hyper links
The most important capability of HTML is its ability to create Links or hyperlinks. Links can be applied to either text or images. Links may connect several web pages of a web site. Links can connect web pages on the same or different servers. Navigation between pages became easier because of links. Information on the same website is also connected with links.
The <a> or anchor tag
The anchor tag <a> is used for creating links. The minimum it requires
is the attribute HREF, which indicates the destination document.
Although attributes, such as "title" and "target" can be useful,
they and all other attributes are optional. Syntax is as follows:
|
<A [attribute(s) {= "value"}]>Hyper Link name or description </A> |
|
<a href="index.html"></a> |
Above the <a> tag with its only nessecary attribute "href", note the link will not actually show up in the browser window until you put text in between the tags as seen below.
|
<a href="index.html">link's text</a> |
The <a> element attributes
Title
The attribute Title is used for giving a descriptive title to the hyper link. The title is visible when the mouse hovers over the hyperlnk ( something like a tooltip). Example your link might just say "Next", so instead of leaving people in the dark as to where "Next" goes to, what better than to have a description in the title.
|
<a href="index.html" title="Go to Home page">link's text</a> |
Test this link's text by positioning your mouse over it.
Target
The attribute Target is to show the browser where to open the link, either in the same window (default and attribute not required in this case) or a new window.
|
<a href="index.html" target="_blank">Home</a> |
Opens new window of the Home page
More attributes will be shown later in the tutorial as they become relevant.