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>

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".