The <a>
element
Short for ‘Anchor’. A hyperlink to another web page or other resource.
Full list of attributes
All the usual HTML global attributes are available
download
- If present, the linked file should be downloaded and saved, instead of the browser following the link as normal. The attribute's value, if any, gives a filename that the browser can offer the user as a suggestion.
href
- Full or relative URI to go to when link is clicked. If this is missing, then the element is just a placeholder for a place where a link might have been, or might be in the future if it's modified by JavaScript code.
hreflang
- Code of language that the linked page is written in (for example
en
for English). ping
- Gives one or more URIs that the browser might used to notify counters that the link has been clicked.
rel
- Specifies the meaning of the link. Can be used if there is a specific relationship between this page and the one being linked to, for example if the
rel=license
if the linked document is a copyright license for this one. target
- The browser context to open the link in, or a special keyword indicating how to open the page, such as
_top
. type
- The MIME type of the file being linked to. For example, you can advise the browser that you're linking to a PDF file by supplying
type="application/pdf"
.