HTML link tag is used to apply link to a word, a sentence or image. A webpage can contain different types of links that take you directly to other pages and allow you to navigate to a specific location.
In HTML links are called Hyperlinks and they are defined using <a> tag.
HTML Link Syntax:
In HTML Links are specified using the <a> tag, which is called an anchor tag. The content between <a>…</a> becomes part of the link and the user can click on that part to reach the specified location.
Explanation of the syntax:
href : The href attribute specifies the destination address of the link used.
Link Text: It is the visible part of the link.
An “Internal Link” is a link in your site that navigates you to another page on your website.
The “External Link” is a link that navigates you away from your site to another website (like http://google.com.
HTML Link Colors:
Different links will appear in different formats such as:
An unvisited link appears as underlined and blue in color by default.
A visited link appears as underlined and purple in color by default.
An active link appears as underlined and red in color by default.
You can change the appearance of links by using CSS:
The target Attribute in HTML Link Tag:
The target attribute specifies the location where to open the linked document.
The target attribute values:
HTML Image as Link:
You can create a hypertext link using an image, it’s simple to use an image as a hyperlink. You just need to use an image inside the hyperlink at the place of text.
Link Title Attribute:
The title attribute in HTML link gives extra information about an element and this information is shown as a tooltip when the mouse moves over it.
HTML Bookmark is useful if you have a long page that you want to allow the users to quickly navigate to different sections on the same web page.
Steps to create Bookmark:
Create a bookmark, using the id attribute.
Add the specified link of the webpage to the bookmark within the same page.
You can create a download link that is used to download a file from the server.
Creating a downloadable link is very simple you just need to give the URL of the file.