HTML Tutorial: Links

  Before we get into the nitty gritty, lets just talk about what a link is. As the name suggests a link will literally link you to another place; when you click on it you will be taken to that place. I should also mention that the full name for a link is, Hypertext link, however, most people drop the word hypertext and just call them links.

So what sorts of places can you link to?


How does the reader know its a link?

There's a number of ways - you can:


Links Within a Page
(Note if you came here via a link - we're still on the same page ). So how did we do it?

Well first we had to create a bookmark. A bookmark is a name given to some text on a page (the text between the <A> and </A> tags), which can be used in a link to tell the browser where to go to. 

The code to do that is:

<a name="LinksBookmark">Links Within a Page</a>

If you use the bookmark called LinksBookmark in a link command then the browser will jump to the text "Links Within a Page". 

.... and the next step is to create that link:

<a href name="LinksBookmark">Go to Links Within a Page</a>

lets look at the syntax ...

The <A> tag - this stands for Anchor. As you may already have noticed it can be used to do different things depending on what attribute is used:

The NAME attribute - when the <A> tag is used with the name attribute i.e name="LinksBookmark", it bookmarks, or in other words gives a name to, a position in the HTML page which can be used in the second type of <A> tag. The one that uses the HREF attribute ............ 

The HREF attribute - short for Hypertext REFerence. This attribute tells the browser where the link is going to. So in the example
<a href name="LinksBookmark">Links Within a Page</a>,
we're telling the browser to go to a bookmark called LinksBookmark which we set up in the first statement. The browser know it must go to somewhere else in the page as opposed to another page because the name attribute appears -

The text between the <A> and </A> tags: well this is what appears on the screen - in the first of the examples it is the text associated with the bookmark - i.e. where the broswer will jump to. In the second example it is the text that the user must click on in order to select the link - so it should be meaningful - we'll see later that it can even be an image.

Clear as mud? Well you'll probably get the hang of this particular HTML TAG faster by using it! Lets move to another bookmark ... Top of Page .