Description

The HTML <a> (anchor) element creates a hyperlink to other web pages, files, email addresses, locations within the same page, or anything else a URL can address.

It is one of the most fundamental HTML elements and is essential for navigation on the web. Without anchor tags the web would not be interconnected.

CSS Display:inline

Syntax

<a href="url">Link text</a>

Popular Attributes

AttributeDescription
hrefRequiredSpecifies the URL the link points to. Can be an absolute or relative URL.
targetSpecifies where to open the linked document. Common values: _blank (new tab), _self (same frame, default), _parent, _top.
relSpecifies the relationship between the current document and the linked document. Common values: noopener, noreferrer, nofollow.
downloadPrompts the user to download the linked resource instead of navigating to it. The value specifies the default filename.
titleProvides advisory text, often displayed as a tooltip on hover.

This element also supports global HTML attributes such as class, id, style, data-*, and more.

Examples

Basic Link
<a href="https://htmlsave.com">Visit HTML Save</a>
Creates a simple hyperlink that navigates to the specified URL when clicked.
Open in New Tab
<a href="https://htmlsave.com" target="_blank" rel="noopener noreferrer">Open in New Tab</a>
Using target="_blank" opens the link in a new browser tab. Always add rel="noopener noreferrer" for security.
Email Link
<a href="mailto:hello@example.com">Send Email</a>
The mailto: protocol opens the user's default email client with the email address pre-filled.

Notes

When using target="_blank", always include rel="noopener noreferrer" to prevent the new page from accessing the window.opener property, which is a security vulnerability known as "tabnapping".

Related Tags

Last updated: 7th April 2026