Mark Wilson I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :
03/24/2008
Times viewed :
3603
The <a> Tag (XHTML Reference)
Introduction
The <a> tag is used to display links. A link is always
required if you are working with WebPages. You can link in two ways with that
tag. For example you can link to another page, or you can link to the same page
but to another section.
Example
This example links to another page. You can replace the
“index.html” with whatever file you like as long as it in the same path. If it
is in another path, then you will also have to provide the path.
<a href=”index.html”>Home</a>
To create a link which just points to another section within
the same page, you have to create anchors. An anchor looks like this:
<a name=”top”>Welcome to…</a>
As you can see I have used the name attribute in that tag
and not the href attribute. This way it will be known as an anchor. Furthermore
this will not be converted to a visible link like you have seen in the first
example. You can imagine this as a simple marker. We can then use the following
link which will jump to the top (Welcome to…) section.
<a href=#top>Jump to top</a>
Working example
<a href="a.html">Home</a>
<p>Here we are going to explain the usage of the
<a> tag. We will cover this and this and
this....<br/><br/><br/><br/><br/><br/><br/><br/><br/>
The <a> tag contains many attributes and events. Here
is a list of available attributes and events.
Attributes
Name:
Description:
Href
Target URL.
Can be any internet address which starts with: http, ftp, telnet, mailto,
etc.
Target
Target Frame to load the page into. Can be one of the
following:
_blank = new window
_self = same window
_parent = parent window
_top = url will be opened in full body of the window
Keyboard
accesskey
Defines an alphabet for the keyboard shortcut. You can use
ALT + alphabet.
tabindex
Defines the number of the index. The lowest number will be
jumped first and highest later.
Language
charset
Defines the character coding of the target url or writes a
page on charset.
hreflang
Defines the language. You have to provide the language
code. Here are some codes:
de = German
en = English
en-us = English (USA)
en-uk = English (UK)
es = Spanish
fr = French
it = Italian
Logical references to target for rel/rev:
With the attribute rel (relationship) you can specify a
relationship to the target. The rev attribute (reverse) specifies a reverse
link from the target document to the current document. These attributes are
used by search engines to provide a linked navigation menu. Both attributes can
have one of the following values: