Links are one of the most important building blocks of the web. They allow us to connect pages, access external sources, send emails, or enable downloads.
The simplest link is an <a> tag that uses the href attribute to specify the target URL. The link text goes between the opening and closing tag.
html
<a href="https://www.example.com">Visit Example</a>
The target="_blank" attribute opens the link in a new browser tab or window. This is useful for external pages.
html
<a href="https://www.example.com" target="_blank">Open in new tab</a>
For internal links, the href points to a local file or path within the same website.
html
<a href="/about.html">About Us</a>
An email link starts with the mailto: prefix followed by the email address.
html
<a href="mailto:[email protected]">Email us</a>
An <a> element can be styled with CSS to look like a button. This is a common technique for call-to-action (CTA) buttons.
html
<a href="/contact.html" style="display: inline-block; padding: 10px 20px; background: #007bff; color: white; text-decoration: none; border-radius: 4px;">
Contact Us
</a>
When opening a link in a new tab, it's recommended to include rel="noopener noreferrer" for improved browser security.
html
<a href="https://external-site.com" target="_blank" rel="noopener noreferrer">Secure External Link</a>
Links are simple yet powerful tools in HTML. They can be used for navigating to other pages, triggering downloads, linking to emails, or building site navigation. Attributes like href, target, and rel help you customize their behavior and appearance.
Select Language
Set theme
© 2025 ReadyTools. All rights reserved.