HTML Anchor Tag (<a>)


The anchor tag creates clickable hyperlinks enabling users to access web pages, files, email addresses and page sections.

  • Web pages
  • Files
  • Email addresses
  • Sections within the same page
<a href="URL">Link Text</a>
 

html-a-href


Example

  • href - specifies the destination (URL)
  • Link Text - the clickable part shown to the user
<a href="https://www.onlinetpoint.com">Visit OnlineTpoint</a> 

Open Link in New Tab

Use the target="_blank" attribute:

 <a href="https://example.com" target="_blank">Open in new tab</a>

Link to an Email Address

Use the mailto: scheme:

 

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

Link to a Phone Number

Use the tel: scheme:

 

<a href="tel:+1234567890">Call Us</a> 

Common Attributes of <a>

Attribute Description
href The destination of the link
target _blank, _self, _parent, _top
title Tooltip text shown on hover
download Indicates link is for downloading a file
rel Specifies relationship (noopener, nofollow)



OnlineTpoint is a website that is meant to offer basic knowledge, practice and learning materials. Though all the examples have been tested and verified, we cannot ensure the correctness or completeness of all the information on our website. All contents published on this website are subject to copyright and are owned by OnlineTpoint. By using this website, you agree that you have read and understood our Terms of Use, Cookie Policy and Privacy Policy.