Rel Attribute for Anchor Tags in HTML
While this tutorial has content that we believe is of great benefit to our community, we have not yet tested or edited it to ensure you have an error-free learning experience. It's on our list, and we're working on it! You can help us out by using the "report an issue" button at the bottom of the tutorial.
The rel attribute inside anchor tags (<a>) describes the relation to the document where the link points to. It’s optional, but a few values can come in very handy. It can take one of these 14 values:
- alternate: Points to an alternate version of the document.
- author: Points to the author of the document.
- bookmark: Points to an URL for bookmarking.
- enclosure: Points to a downloadable asset.
- external: Points to an URL on a different domain.
- help: Points to an help document.
- license: Points to legal, license or copyright information.
- next: Points to the next document in a series.
- nofollow: Indicates to search engines that the document in not endorsed. This is the most commonly used value and should be used for paid links and ads.
- noreferrer: Indicates to the browser not to send an HTTP referrer header.
- noopener: Prevent an opener browsing context. It should be used when using target=“_blank” on a link. Mathias Bynens discussed the security benefits of this and Jake Archibald discussed the performance benefits.
- prev: Points to the previous document in a series.
- search: Points to a search function for the document.
- tag: Points to a document that’s covers a keyword/tag of the current document.