Anchor rel and rev Attributes
Definition and Usage
The rel attribute sets or returns the relationship to the target document.
The rev attribute sets or returns the reverse relationship of a link.
The rel (relationship) attribute specifies the relationship from the source document to the target document.
The rev (reverse) attribute specifies the reverse relationship from the target document to the current document.
Syntax
Set rel attribute:
Set rev attribute:
Return rel attribute:
Return rev attribute:
Both attributes can take the following values:
| Value | Description |
|---|---|
| alternate | Links to an alternate source. |
| stylesheet | External stylesheet for the document. |
| start | Links to the first page of the current document. |
| next | Links to the next document in the collection. |
| prev | Links to the previous document in the collection. |
| contents | Links to the table of contents of the current document. |
| index | Links to the index of the current document. |
| glossary | Links to the glossary of the current document. |
| copyright | Links to the copyright or privacy page of the current document. |
| chapter | Links from the current document to a chapter. |
| section | Links to a section in the document list. |
| subsection | Links to a subsection in the current document list. (A section can have multiple subsections.) |
| appendix | Links to the appendix page of the document. |
| help | Help document. |
| bookmark | Links to a bookmark. |
| nofollow | The nofollow tag is an innovation led by Google to combat spam links. It instructs search engines not to follow any outbound links with the nofollow attribute on a webpage, thereby reducing the dispersion of site authority by spam links! |
| licence | |
| tag | |
| friend |
Browser Support
All major browsers support the rel and rev attributes.
Note: Browsers do not use these attributes in any way. However, search engines can use these attributes to obtain more information about the links.
Example
Example
Returns the relationship between the current document and the linked document:
The output of the above example: