HTML <a> Tag
<a> HTML element is one of the most important in HTML and is intended for creating links. To do this, you need to tell the browser what the link is, and also indicate the address of the document to which you want to link. The value of the href attribute is the address of the document to which the transition takes place. The link address can be absolute and relative. Absolute addresses work everywhere, regardless of the name of the site or web page where the link is registered. Relative links, as their name implies, are built relative to the current document or the root of the site. The
<a> element is usually referred to as a link or a hyperlink.
- Permitted Parents
- Any element that accepts phrasing content, or any element that accepts flow content, but always excluding
- Inline and text
- Start/End Tags
- Start tag: required, End tag: required
Example of the <a href="https://www.cssportal.com/html-tags/tag-a.php" target="_blank">a tag</a>, used in html.
|href||Specifies the location of a Web resource, thus defining a link between the current element (the source anchor) and the destination anchor defined by this attribute.|
Specifies the target frame to load the page into.
Specifies the relationship from the current
document to the anchor specified by the
href attribute. Multiple values can be provided, separated by a space.
|media||Specifies what media/device the target URL is optimized for. Default value: all|
|hreflang||Specifies the base language of the resource designated by href and may only be used when href is specified.|
|type||Specifies the MIME type of the linked resource. Only to be used when the href attribute is present.|
<a> tag also supports the Global Attributes in HTML5
<a> tag also supports the Event Attributes in HTML5
|Tablets / Mobile|