a rel attribute
The rel attribute on the a element:
- allows you to specify the relationship between the linked resource and the current document
- rel is a specific attribute → can be applied ONLY on the next HTML5 elements: a, area, link
The values of the rel attribute on element:
- - alternate : the linked resource represents an alternate resource
- author : the linked resource has information about the author of the current page
- bookmark : the permalink
- help : the linked resource provides help information for the current page
- license : the linked resource has information about the license of the current page
- next : the linked resource represents the next page
- nofollow : search engine spiders should not follow the linked resource
- noreferrer : no HTTP referrer header (from user agents) for the linked resource
- prefetch : the linked resource will be prefetched
- prev : the linked resource represents the previous page
- search : the linked resource allows you to search information in the current page and its related pages
- tag : the linked resource represents a tag for the document
Examples
<a | attribute | = | "value(s)" | > | ... | <⁄a> | example |
---|---|---|---|---|---|---|---|
5. | rel | = | alternate, author, bookmark, help license, next, nofollow, noreferrer prefetch, prev, search, tag | <href="http://site_user.com" rel="nofollow"> ... <⁄ > |
Video demonstration a rel attribute
HTML5 a rel attribute Tutorial
min | video details |
---|---|
00:08 | video tutorial: a element, rel attribute objective: understanding rel attribute |
00:16 | the rel attribute: - is optional - can be used only if href attribute is present - allows you to specify the relationship between the linked resource and the current document (the type of the link) |
00:22 | this video demo presents only 1 value: the nofollow value ⁄keyword only |
00:25 | href attribute is presents on the a element → we can add the rel attribute also to it |
00:30 | saying you're allowing comments on your website -blog; the users, besides comments, can add links too; the question is: Do you want search engines to follow that link? |
00:40 | you don't know what's on that page, whether is trustful or not... → you'll probably want to advise the search engine spiders not to follow that link |
00:46 | How to do that ? Answer: use rel attribute, value nofollow |
01:04 | the attribute and its value has been added to a element → the search engine spiders now know NOT TO FOLLOW the mywebpage.php |