HTML Anchor

The HTML <a> tag defines a hyperlink, which is used to link one page to another page, file, location within the same page, or any external URL. The most crucial attribute of the anchor tag is href, which specifies the destination of the link.

The href Attribute

The href attribute stands for "hypertext reference." It is used to define the URL or path to the resource that the link points to.

syntax:

<a href="...........">Link Text</a>

Example:

<a href="https://waytocode.in/">Visit Example.com</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.