HTML Hyperlinks

HTML hyperlinks are used to connect one webpage to another. They allow users to navigate between pages, websites, documents, images, email addresses, and specific sections within a webpage. Hyperlinks are created using the <a> (anchor) tag.


Syntax


<a href="URL">

    Link Text

</a>


Types of Hyperlinks

  • External Links - Links to another website.
  • Internal Links - Links between pages of the same website.
  • Email Links - Used to open email applications.
  • Telephone Links - Used to make phone calls.
  • Bookmark Links - Links to specific sections of a webpage.

Examples

1. External Link


<a href="https://www.google.com">

Google

</a>

2. Internal Link


<a href="about.html">

About Us

</a>

3. Email Link


<a href="mailto:info@example.com">

Send Email

</a>

4. Telephone Link


<a href="tel:+919876543210">

Call Us

</a>

5. Bookmark Link


<a href="#top">

Go to Top

</a>


Anchor Tag Attributes

  • href - Specifies the destination URL.
  • target - Opens the link in a new or same tab.
  • title - Displays tooltip text.
  • download - Downloads the linked file.

Best Practices

  • Use meaningful link text.
  • Always provide a valid href value.
  • Use target="_blank" for external websites.
  • Use relative links for pages inside your website.
  • Avoid using "Click Here" as link text.
  • Keep hyperlinks easy to identify.