HTML Anchor
HTML Anchor
The HTML anchor tag defines a hyperlink that links one page to another page. The "href" attribute is the most important attribute of the HTML a tag.
href attribute of HTML anchor tag
The href attribute is used to define the address of the file to be linked. In other words, it points out the destination page.
The syntax of HTML anchor tag is given below.
<a href = "..........."> Link Text </a>
Example of HTML anchor tag.
<a href="http://www.easytolearning.com/">Click for Second Page</a>
Appearance of HTML anchor tag
- An unvisited link is displayed underlined and blue.
- A visited link displayed underlined and purple.
- An active link is underlined and red.
Supporting Browsers
| Element | Chrome | IE | Firefox | Opera | Safari |
| <h1> to <h6> | Yes | Yes | Yes | Yes | Yes |
Attributes
| Attribute | Value | Description |
|---|---|---|
| charset | char_encoding | Not supported in HTML5. Specifies the character-set of a linked document |
| coords | coordinates | Not supported in HTML5. Specifies the coordinates of a link |
| download | filename | Specifies that the target will be downloaded when a user clicks on the hyperlink |
| href | URL | Specifies the URL of the page the link goes to |
| hreflang | language_code | Specifies the language of the linked document |
| media | media_query | Specifies what media/device the linked document is optimized for |
| name | section_name | Not supported in HTML5. Use the global id attribute instead. Specifies the name of an anchor |
| rel | alternate author bookmark external help license next nofollow noreferrer noopener prev search tag |
Specifies the relationship between the current document and the linked document |
| rev | text | Not supported in HTML5. Specifies the relationship between the linked document and the current document |
| shape | default rect circle poly |
Not supported in HTML5. Specifies the shape of a link |
| target | _blank _parent _self _top framename |
Specifies where to open the linked document |
| type | media_type | Specifies the media type of the linked document |
Series:
HTML Tutorials Hub
