FANDOM


A
Basic usage: <a></a>
Spec version 1.0
IE Version 1.0
Firefox 1.0
Google Chrome 1.0
Safari 1.0
Opera 1.0
Example output:
http://html.wikia.com

The a element (also known as the Hypertext Module) is generally used to link to a specfic location or as an anchor that can be linked to, however can act as both at the same time.

AtributesEdit

The following attributes can be used with the a element:

Common attributes

Attribute Value Description
class classname Specifies a classname for an element
id id Specifies a unique id for an element
style style_definition Specifies an inline style for an element
title text Specifies extra information about an element
dir ltr
rtl
Specifies the text direction for the content in an element
lang language_code Specifies a language code for the content in an element. Language code reference.
xml:lang language_code Specifies a language code for the content in an element, in XHTML documents. Language code reference.
accesskey character Specifies a keyboard shortcut to access an element
tabindex number Specifies the tab order of an element


Event Attributes

Attribute Value Description
onblur script Script to be run when an element loses focus
onfocus script Script to be run when an element gets focus
onkeydown script Script to be run when a key is pressed
onkeypress script Script to be run when a key is pressed and released
onkeyup script Script to be run when a key is released
onclick script Script to be run on a mouse click
ondblclick script Script to be run on a mouse double-click
onmousemove script Script to be run when mouse pointer moves
onmouseout script Script to be run when mouse pointer moves out of an element
onmouseover script Script to be run when mouse pointer moves over an element
onmouseup script Script to be run when mouse button is released



Optional AttributesEdit

Attribute Value Description
charset char_encoding Specifies the character-set of a linked document
coords coordinates Specifies the coordinates of a link
href URL Specifies the destination of a link
hreflang language_code Specifies the language of a linked document
name section_name Specifies the name of an anchor
rel text Specifies the relationship between the current document and the linked document
rev text Specifies the relationship between the linked document and the current document
shape default
rect
circle
poly
Specifies the shape of a link
target _blank
_parent
_self
_top
framename
Specifies where to open the linked document

External LinksEdit

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.