HTML Reference
C.6 Text-Level Semantics
<a>
Full name
Anchor
Description
Represents a hyperlink or the named target destination for a
hyperlink.
Display
Inline
Attributes
href
If the <a> element is used as a hyperlink, this is a required attribute. Its value specifies
the link target in the form of a URL. Apart from the usual HTTP protocol for transfer-
ring hypertext documents, other protocols can be used as well (e.g., HTTPS, FILE, or
FTP). One can even establish a link to an internal target location within a document
(marked by another <a> element with an id a ttribute). This can be done by means of
a URL fragment, which is a n ame prece ded by a hash m ark (#).
target
This attribute specifies whe re to display the linked co ntent. If you use the _blank
keyword as a value of this attribute, the conte nt will be displayed in a new tab or
window.
Examples
<!-- A link to a hypertext document. -->
<a href="http://www.someweirdstuff.org/memberlogin.html">Let’s go
somewhere</a>
<!-- Open the document in a new tab/window. -->
<a href="http://www.someweirdstuff.org/memberlogin.html"
target="_blank">Let’s go somewhere</a>
<!-- A link to a PDF document. -->
<a href="http://www.someweirdstuff.org/appform.pdf">Application
form</a>
<!-- Mark a specific location within a page
www.someweirdstuff.org/benefits.html. -->
<a id="somewhere">This is totally amazing</a>
<!-- Link to that specific location from within the same page. -->
C.6. Text-Level Semantics 321