html
  1. html-a-tag

HTML <a> Tag

  • The <a> tag stands for "anchor" and is primarily used to create hyperlinks on web pages.
  • When you wrap text or an image with <a> tags, you're essentially creating a clickable link.
  • The <a> tag is accompanied by the href attribute, which specifies the destination URL of the link.

href (Hypertext Reference)

This is the most essential attribute. It specifies the destination URL or the location where the link will take the user.

 <a href="https://additionalsheet.com/">Click me!</a>
Try Playground

target

This attribute determines where the linked document will be opened. Common values include "_blank" (opens in a new tab or window) and "_self" (opens in the same tab or window).

 <a  href="https://additionalsheet.com/" target="_blank" >Click me!</a>
Try Playground

title

This attribute provides additional information about the link when the user hovers over it.

 <a  href="https://additionalsheet.com/" title="additionalsheet" >Click me!</a>
Try Playground

download

This attribute, when present, suggests that the target should be downloaded rather than navigated to.

<a href="example.pdf" download>Download PDF</a>
Try Playground

rel (Relationship)

This attribute defines the relationship between the current document and the linked document. Common values include "nofollow" and "noopener."

<a rel="nofollow" href="https://additionalsheet.com/ ">Click me!</a>

These are just a few examples of the attributes you can use with the <a> tag. Each attribute contributes to the functionality and presentation of the hyperlink on your webpage.

Try Playground
Published on: