HTML <a> tag

HTML <a> tag

The <a> tag defines a hyperlink. This is usually a link to another document.

Example

HTML Online Editor
<!DOCTYPE html> <html> <body> <a href="/css">Learn CSS.</a> </body> </html>

Attributes

The following are the attributes of <a> tag. Also try Global attributes.

AttributeValueExplanation
downloadfile_nameDownload the target file.
hrefurlContains the URL of the page the link goes to.
hreflanglanguage_codeDefines the language used in the linked file.
mediamedia_queryDefines what device/media the linked file optimized for.
relalternate
author
bookmark
external
help
license
next
nofollow
noreferrer
noopener
prev
search
tag
Defines the relationship between the current document and the linked document.
target_blank
_parent
_self
_top
Specifies where to open the linked document.
typemedia typeDefines the media type of the linked file.

Deprecated Attributes

The following attributes should not be used in any case.

AttributeValueExplanation
charset
  • ASCII
  • ANSI
  • 8859-1
  • UTF-8
Specifies the character encoding of the linked URL.
coordsp1, p2,..., pnSpecifies the coordinates of the link. Used when shape attribute is defined.
namesection_nameSpecifies a possible target location within a page.
revtextSpecifies the relationship between the linked document and the current document.
shape
  • default
  • rect
  • circle
  • poly
Specifies the shape of a link.

Reminder

Hi Developers, we almost covered 99.5% of HTML Tutorials with examples for quick and easy learning.

We are working to cover every Single Concept in HTML.

Please do google search for:

Join Our Channel

Join our telegram channel to get an instant update on depreciation and new features on HTML, CSS, JavaScript, jQuery, Node.js, PHP and Python.

This channel is primarily useful for Full Stack Web Developer.

Meet the Author