The <a> tag in HTML creates a hyperlink to a specified URL. The <a> tag is also known as the anchor tag. It can point to:
- Another website
- The same website
- A different section of the same website
The <a> tag has several attributes, including:
- href: Indicates the link’s destination
- name: Defines the beginning and end of a link
- target: Defines the beginning and end of a link
The <a> tag can provide an absolute reference or a relative reference as its “href” value. If there is no value, the browser will suggest a filename/extension. The browser can generate the filename/extension from:
- The Content-Disposition HTTP header
- The final segment in the URL path
- The media type