a
content is "Inline" except that anchors shouldn't be nested
A Tag
The content of an A
tag is “inline” except in the case of anchors which shouldn’t be nested. An A
tag represents a target in which to link to or an anchor in which a link is going.
Attributes are:
Attribute | Description | Default Value | Values | Required |
---|---|---|---|---|
id | document-wide unique id | no | ||
class | space separated list of classes | no | ||
style | associated style info | no | ||
accesskey | accessibility key character | no | ||
tabindex | position in tabbing order | no | ||
charset | This attribute specifies the character encoding of the resource designated by the link. Please consult the section on [character encodings](http://www.w3.org/TR/html401/charset.html) for more details. | no | ||
type | This attribute gives an advisory hint as to the content type of the content available at the link target address. It allows user agents to opt to use a fallback mechanism rather than fetch the content if they are advised that they will get content in a content type they do not support. | no | ||
name | This attribute names the current anchor so that it may be the destination of another link. The value of this attribute must be a unique anchor name. The scope of this name is the current document. | no | ||
href | This attribute specifies the location of a Web resource, thus defining a link between the current element (the source anchor) and the destination anchor defined by this attribute. A Uniform Resource Identifier, see [RFC2396](http://www.ietf.org/rfc/rfc2396.txt) | no | ||
hreflang | This attribute specifies the base language of the resource designated by href and may only be used when href is specified. A language code, as per [RFC3066](http://www.ietf.org/rfc/rfc3066.txt) | no | ||
rel | This attribute describes the relationship from the current document to the anchor specified by the href attribute. The value of this attribute is a space-separated list of link types. | no | ||
rev | This attribute is used to describe a reverse link from the anchor specified by the href attribute to the current document. The value of this attribute is a space-separated list of link types. | no | ||
shape | This attribute specifies the shape of a region. | rect | no | |
coords | comma separated list of lengths | no | ||
target | This is the location on which the target will load | _blank, _new | no | |
title | This information may be spoken by a user agent, rendered as a tool tip, cause a change in cursor image, etc. | no |
Example Href:
<a id="developwith-link"
accesskey="m"
tabindex="1"
class="external-link"
href="http://www.developwith.com" > Develop With</a>
Example Anchor:
<a href="#mytarget" title="My Target Section" >My Target Section</a>
Lots of text possibly.
<a name="mytarget" />
<h1> My Target </h1>
##Events##
Event | Description |
---|---|
onclick | The onclick event occurs when the pointing device button is clicked over an element. This attribute may be used with most elements. |
ondblclick | The ondblclick event occurs when the pointing device button is double clicked over an element. This attribute may be used with most elements. |
onmousedown | The onmousedown event occurs when the pointing device button is pressed over an element. This attribute may be used with most elements. |
onmouseup | The onmouseup event occurs when the pointing device button is released over an element. This attribute may be used with most elements. |
onmouseover | The onmouseover event occurs when the pointing device is moved onto an element. This attribute may be used with most elements. |
onmousemove | The onmousemove event occurs when the pointing device is moved while it is over an element. This attribute may be used with most elements. |
onmouseout | The onmouseout event occurs when the pointing device is moved away from an element. This attribute may be used with most elements. |
onfocus | The onfocus event occurs when an element receives focus either by the pointing device or by tabbing navigation. This attribute may be used with the following elements: A, AREA, LABEL, INPUT, SELECT, TEXTAREA, and BUTTON. |
onblur | The onblur event occurs when an element loses focus either by the pointing device or by tabbing navigation. It may be used with the same elements as onfocus. |
onkeypress | The onkeypress event occurs when a key is pressed and released over an element. This attribute may be used with most elements. |
onkeydown | The onkeydown event occurs when a key is pressed down over an element. This attribute may be used with most elements. |
onkeyup | The onkeyup event occurs when a key is released over an element. This attribute may be used with most elements. |