The <a> (anchor) element creates a hyperlink. Its href is the destination, which can be a URL, a path, an in-page anchor, or a special scheme.
External site
Internal page (relative)
Jump to an element with id="section2"
Send email
Call us
The <a> (anchor) element creates a hyperlink. Its href is the destination, which can be a URL, a path, an in-page anchor, or a special scheme.
External site
Internal page (relative)
Jump to an element with id="section2"
Send email
Call us
<a href="https://other.com" target="_blank" rel="noopener noreferrer">
Opens in a new tab
</a>
target="_blank" opens a new tab, but you should add rel="noopener": without it, the new page can access window.opener and potentially redirect your page (a "tab-nabbing" attack). noreferrer also strips the referrer header. Modern browsers imply noopener for _blank, but adding it explicitly is best practice.
<a href="..." rel="nofollow">Don't pass SEO ranking (untrusted/user links)</a>
<a href="..." rel="noopener">Security: no window.opener access</a>
<a href="..." rel="sponsored">Paid/affiliate link</a>
<a href="#top">Back to top</a>
...
<div id="top">...</div> <!-- the link scrolls here -->
Clicking scrolls to the element whose id matches the fragment.
Anchors are the backbone of the web's navigation.
Knowing the href schemes (relative, absolute, fragment, mailto/tel), the target="_blank" + rel="noopener" security pairing, and the SEO-relevant rel values is essential for correct, safe linking.