a tag (HTML 4.01)
hyperlinks (anchor tag)Hyperlinking is likely one of the single most important features of the World Wide Web. A hyperlink is created with the <A> tag, and in it's most basic form, it only requires a single attribute, the href attribute.
For instance, a simple link tag would look like this:
<a href="http://www.htmlpedia.net/">Visit htmlpedia.net</a>
And the result would look like this in the browser:
Using the title attribute
The title attribute can be used to give more information about the destination of the link. The text will be shown when the user hovers the mouse over links in most modern browsers. Here's an example:
<a href="http://www.htmlpedia.net/" title="htmlpedia.net has the most comprehensive HTML reference online!">Visit htmlpedia.net</a>
To see how it looks, hover your mouse over this link:
Attributes
| Attribute | Deprecated | Required | Description |
|---|---|---|---|
| accesskey | accessibility key character | ||
| charset | char encoding of linked resource | ||
| class | space-separated list of classes | ||
| dir | direction for weak/neutral text | ||
| href | URI for linked resource | ||
| hreflang | language code | ||
| id | document-wide unique id | ||
| lang | language code | ||
| name | named link end | ||
| rel | forward link types | ||
| rev | reverse link types | ||
| style | associated style info | ||
| target | render in this frame | ||
| title | advisory title | ||
| type | advisory content type |
Events
| Event | Description |
|---|---|
| onblur | the element lost the focus |
| onclick | a pointer button was clicked |
| ondblclick | a pointer button was double clicked |
| onfocus | the element got the focus |
| onkeydown | a key was pressed down |
| onkeypress | a key was pressed and released |
| onkeyup | a key was released |
| onmousedown | a pointer button was pressed down |
| onmousemove | a pointer was moved within |
| onmouseout | a pointer was moved away |
| onmouseover | a pointer was moved onto |
| onmouseup | a pointer button was released |
© htmlpedia.net 2008 - 2012