HTML Tag: a
Anchor. Primarily used as a hypertext link. The link can be to another page, a part of a page or any other location on the web.
Optional Attributes
Attribute | Description | Possible values |
---|---|---|
href |
The target destination of a link. | URL. |
target |
The browsing context in which the target destination should open. |
|
download |
Indicates that the target should be downloaded instead of navigated to. | None. |
rel |
The relationship between the link’s page and the link’s target destination. |
|
hreflang |
The language of the target of the link. It should only be used when href |
Language code, such as en (English) or es (Spanish). |
type |
The MIME type of the linked resource. | Text. |
Global attributes |
Example
<p><a href="http://www.htmldog.com">Link to a URL</a></p>
<p><a href="#content">Link to a page anchor</a></p>
<p><a href="smidgen.pdf" download>Link to a resource to download</a></p>