Anchor tags


Ok, now we talk about links...

<A> (Anchor) and </A> tags are used to 'anchor' documents each other. Remember? You can link HTML documents each other, you can link documents to gopher sources, to FTP sources, Telnet and so on...The syntax is:

<A HREF="something">

Where 'something' may be:

URL

In this case, you could link another document which is located to another web server. You have to use the HREF parameter to indicate the URL. For example inside of your page you could put this link:

Look at this great site!

And this is the HTML page's source:

<html>
<head>
</head>
<body>
<A HREF="http://www.wowarea.com"> Look at this great site!</A>
</body>
</html>

Notice that you could put an image within the <A> and </A> tags. A button for example:

And this is the HTML page's source:

<html>
<head>
</head>
<body>
<A HREF="http://www.wowarea.com"> <IMG SRC="button.gif"></A>
</body>
</html>

We will discuss about the <IMG> tag on 'Image tags'...

Bookmark

You can put bookmarks inside of your page; so, for example, if your page is very big, you could put a summary at the top of page. Items of that summary will point to sections of your page. In this case you have to use the HREF parameter with the '#' symbol and the NAME parameter. The # point to the label inside of the NAME tag. The syntax is:

<A HREF="#something">

For example:

Go to the top of page!

And this is the HTML page's source:

<html>
<head>
</head>
<body>
<A HREF="#something">Go to the top of page!</A>
</body>
</html>

Where 'something' is the bookmark. If you look at the HTML source of this page, you will see that I have put an anchor with the NAME parameter at the title.

And this is the HTML page's source:

<A NAME="something">Anchor tags</A>

URL and Bookmark

You can point to a bookmark contained in the page linked by a certain URL. It's like previous case, but here you have to add the URL. The syntax is:

<A HREF="url#something">

So, for example:

<A HREF="http://www.name_of_site.com/pages/page.htm#bookmark">Look here!</A>

This link (Look here!) will point to the page 'page.htm' located at site 'www.name_of_site.com". This link don't point to the beginning of page, but it point to the part of document labeled with 'bookmark' (by means of the <A NAME="bookmark"> tag).


Index           Home  Back  Forward       About  Contact us!

Copyright (c) 1998-2006 Wowarea