Links are found in almost all web pages. HTML links allow users to click and jump from one page to another page, file, email, or location.
<a>
HTML links are also called hyperlinks. They help users move from one document to another. When you click a link, the browser opens the linked page or resource.
<a href="URL">Link Text</a>
<a href="https://www.soopropathshala.com">Visit Pathshala</a>
If you want a link to open in a new tab, use the target="_blank" attribute.
<a href="https://www.google.com" target="_blank">Open Google</a>
| Value | Description |
|---|---|
_self |
Opens in the same tab or window |
_blank |
Opens in a new tab or window |
_parent |
Opens in the parent frame |
_top |
Opens in the full body of the window |
The rel attribute defines the relationship between the current document and the linked page.
It is often used with target="_blank" for security.
<a href="https://example.com" target="_blank" rel="noopener noreferrer">Visit Website</a>
HTML links can also open the userβs email client.
<a href="mailto:info@example.com">Send Email</a>
HTML links can also start a phone call on supported devices.
<a href="tel:+919999999999">Call Us</a>
<a>.href attribute specifies the URL of the page or resource.target="_blank" opens a link in a new tab.rel="noopener noreferrer" improves security for external links.Which attribute specifies the destination of a link?