HTML - Hyper(Link) (href elements)
Table of Contents
1 - About
A link in HTML is an element that have the href attributes.
href stands for hypertext reference and force the user agent to navigate to those resources.
2 - Articles Related
3 - Element
The following elements are hyperlink
- HTML - (Area Element|Image-map hyperlink)
4 - Rel Attribute
4.1 - Link type
- rel=“sponsored”: identify links that were created as part of advertisements, sponsorships or other compensation agreements.
- rel=“ugc” where UGC stands for User Generated Content and tag user generated content, such as comments and forum posts.
- rel=“nofollow” no endorsement, including passing along ranking credit to another page. Robot - Follow / NoFollow instruction
More Evolving “nofollow” – new ways to identify the nature of links
4.2 - Security
- rel=”noopener” prevents a new tab from taking advantage of the window.opener feature.
- rel=”noreferrer” prevents passing on the referrer information to the new tab.
5 - Anchor
See Anchorjs
6 - Javascript
The document property document.links returns an HTMLCollection of the a and area elements in the Document that have href attributes.
6.1 - Spa
In a single page application, use the history api otherwise Google may not find the link use-history-api