Anchors and Hyperlinks

suggest change

Introduction

Anchor tags are commonly used to link separate web pages, but they can also link to different places in a single document, often in a table of contents, or launch external applications. This topic explains the implementation and application of HTML anchor tags in various roles.

Syntax

Parameters

Parameter | Details |

——— | —–– |

href | Specifies the destination address. It can be an absolute or relative URL, or a fragment such as #section that matches an element’s id. The name attribute on <a> is obsolete. An absolute URL is the complete URL of a website like http://example.com/. A relative URL points to another directory and/or document inside the same website, e.g. /about-us/ points to the directory “about-us” inside the root directory (/). When pointing to another directory without explicitly specifying the document, web servers typically return the document “index.html” inside that directory. |hreflang | Specifies the language of the resource linked by the href attribute (which must be present with this one). Use language values from BCP 47 for HTML5 and RFC 1766 for HTML 4. |rel | Specifies the relationship between the current document and the linked document. For HTML5, the values must be defined in the specification or registered in the Microformats wiki. |target | Specifies where to open the link, e.g. in a new tab or window. Possible values are _blank, _self, _parent, _top, and a browsing-context name. Named framesets are obsolete; a name still selects an iframe with that name. Forcing a browsing context is not recommended since it takes control away from the user. |title | Specifies extra information about a link. The information is most often shown as a tooltip text when the cursor moves over the link. This attribute is not restricted to links, it can be used on almost all HTML tags. |download | Asks the browser to download the target instead of navigating to it. If the attribute has a value, that value is the suggested file name. The browser does not reliably invent a file extension for you. If the value is omitted, the original filename is used. |

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents