Easy Tutorial
❮ Canvas Rotate Att Th Nowrap ❯

HTML <a> href Attribute

HTML <a> Tag

Example

The href attribute specifies the target address of a link:


Browser Support

All major browsers support the href attribute.


Definition and Usage

The href attribute in the <a> tag is used to specify the URL of the hyperlink target.

If the href attribute is not specified, the <a> tag will not be a link.


Differences Between HTML 4.01 and HTML5

In HTML5, if the <a> tag does not have the href attribute, it will be a placeholder for a hyperlink.


Syntax

Attribute Values

Value Description
URL The URL of the hyperlink. Possible values: Absolute URL - points to another site (e.g., href="http://www.example.com/index.htm")<br>Relative URL - points to a file within the site (e.g., href="index.htm")<br>Anchor URL - points to an anchor in the page (e.g., href="#top")

More Examples

Using Anchor URLs


HTML <a> Tag

❮ Canvas Rotate Att Th Nowrap ❯