Version-//W3C//DTD XHTML 1.0 Transitional//EN
Elementa
Purposeanchor for hypertext link
DescriptionThe anchor, a, is the element used to create hypertext links. It is one of the most popularly-used elements. You can create a hypertext link from one document to another by using the href attribute. Note that a cannot contain another a.
Start tagRequired <a>
Attributes
NameTypeDefaultComment
accesskey CDATA #IMPLIEDa single character as per XML specification which defines a character as an atomic unit of text as specified by ISO/IEC 10646 [ISO/IEC 10646] (see also [ISO/IEC 10646-2000]); accessibility key character
charset CDATA #IMPLIEDa character encoding as per RFC2045; char encoding of linked resource
class CDATA #IMPLIEDspace-separated list of classes
coords CDATA #IMPLIEDcomma-separated list of lengths; for use with client-side image maps
dir( ltr | rtl )#IMPLIEDdirection for weak/neutral text
href CDATA #IMPLIEDUniform Resource Identifier as per RFC2396; a Uniform Resource Locator (URL) is a URI; URI for linked resource
hreflangNMTOKEN#IMPLIEDlanguage code as RFC3066
idID#IMPLIEDdocument-wide unique id
langNMTOKEN#IMPLIEDlanguage code (backwards compatible); language code as RFC3066
nameNMTOKEN#IMPLIEDnamed link end
onblur CDATA #IMPLIEDscript expression; the element lost the focus
onclick CDATA #IMPLIEDa pointer button was clicked; script expression
ondblclick CDATA #IMPLIEDa pointer button was double clicked; script expression
onfocus CDATA #IMPLIEDscript expression; the element got the focus
onkeydown CDATA #IMPLIEDa key was pressed down; script expression
onkeypress CDATA #IMPLIEDa key was pressed and released; script expression
onkeyup CDATA #IMPLIEDa key was released; script expression
onmousedown CDATA #IMPLIEDa pointer button was pressed down; script expression
onmousemove CDATA #IMPLIEDa pointer was moved within; script expression
onmouseout CDATA #IMPLIEDa pointer was moved away; script expression
onmouseover CDATA #IMPLIEDa pointer was moved onto; script expression
onmouseup CDATA #IMPLIEDa pointer button was released; script expression
rel CDATA #IMPLIEDspace-separated list of link types; forward link types
rev CDATA #IMPLIEDspace-separated list of link types; reverse link types
shape( rect | circle | poly | default )"rect"shape; for use with client-side image maps
style CDATA #IMPLIEDassociated style info; style sheet data
tabindex CDATA #IMPLIEDone or more digits; position in tabbing order
targetNMTOKEN#IMPLIEDrender in this frame
title CDATA #IMPLIEDadvisory title; text used for titles
type CDATA #IMPLIEDmedia type as per RFC2045; advisory content type
xml:langNMTOKEN#IMPLIEDlanguage code (as per XML 1.0 spec); language code as RFC3066
Content( #PCDATA | br | span | bdo | object | applet | img | map | iframe | tt | i | b | u | s | strike | big | small | font | basefont | em | strong | dfn | code | q | samp | kbd | var | cite | abbr | acronym | sub | sup | input | select | textarea | label | button | ins | del | script )*
End tagRequired </a>
Referenced in abbr acronym address applet b bdo big blockquote body caption center cite code dd del dfn div dt em fieldset font form h1 h2 h3 h4 h5 h6 i iframe ins kbd label legend li noframes noscript object p pre q s samp small span strike strong sub sup td th tt u var
Example
SourceAppearance
<p>Link to another document: <a href="http://www.w3.org/">W3C</a></p>
<p>Title attribute set: <a href="http://www.w3.org/"
title="The World Wide Web Consortium">W3C</a></p>
<p>An image in the "hotspot":
<a href="http://www.december.com/html/"><img src="http://www.december.com/html/images/icon.gif"
alt="The HTML Station" /></a></p>
<p>Naming an anchor: <a href="http://www.w3.org/" name="reference-to-w3c"
id="reference-to-w3c">W3C</a></p>
<p>Link to named anchor in this document: Learn about it
<a href="#reference-to-w3c">at the W3C</a></p>
<p>Link to a named anchor in another document: You can learn about
<a href="http://www.december.com/john/faq.html#lastname">my last name on my
FAQ</a>.</p>

Link to another document: W3C

Title attribute set: W3C

An image in the "hotspot": The HTML Station

Naming an anchor: W3C

Link to named anchor in this document: Learn about it at the W3C

Link to a named anchor in another document: You can learn about my last name on my FAQ.

Save this page to any social bookmarking site! Share · Search · Market · Directory
2015-11-01 · John December · Contact · Terms of Use © December Communications, Inc.