The "a" tag, known as the anchor element, states a hyperlink to a web page. The hyperlink can navigate to the same page or a different page on the web. It can also link to a section of a web page.
When defined, the a tag could be easily used in the following way.
Links can be created to an external site in the same way as linking within the same site except that an absolute URL is required.
Links can be created to any section of a page by using the id of that section. id is a global attribute and hence all elements support it. To link to the required element, id of that element needs to be set and then linked to using the hash "#" symbol.
Images can be used to link to web documents. Sometimes a page can display thumbnails and when clicked the full image will open up.
Links can be created to an email address by using the mailto link. The mailto links are quite interesting as it can be used to send emails to multiple recipients, cc'ed recipients, subject added and also sent without a recipient.
Links can be created to phone numbers. Since most websites are (should be) compatible with mobile browsers, it is very useful to be able to link to phone numbers. For example, a website can have a contact us page with links to phone numbers that can be dialled from a phone.
Files can be downloaded by using the "download" attribute of the </a> tag. The download attribute is introduced as part of HTML5. Note that all browsers do not support the download attribute.
Links can be styled like any other elements. For example, color, background color, etc can be set. Custom styling can also be applied when the element is hovered over or clicked previously.