Revision as of 18:54, 23 February 2007

"rel" attribute frequently asked questions

This document serves to answer and discuss frequently asked questions about the HTML4 "rel" and "rev" attributes, and their linktype values. Specifically this document explores a number of issues common to and exposed by the various microformats which extend the HTML4 rel attribute.

What does a rel value really mean?

The rel values in HTML follow a consistent pattern which at a minimum implies a deliberate design. rel describes the relationship of a hyperlink in terms of what the destination (href) is, to the source, or from the source's perspective. rel="stylesheet" is perhaps the easiest example to understand in this manner, because it is saying that this resource over there (indicated with the href) is a "stylesheet" for the current document. Similarly, rel="help" link states that the resource indicated by the href is "help" (e.g. a help file or FAQ) for the current document. All the rest of the values defined in HTML4 also follow this pattern of being a noun which labels the resource indicated by the href, from the perspective of the current document.

Then what does "rev" mean?

"rev" is the precise opposite (or "reverse") of the "rel" attribute. E.g. a rev="help" link indicates that the current document is "help" for the resource indicated by the href.

Is rel single or bi directional?

Though the HTML4 specification is not specific on this point, all the rel values in the HTML4 specification follow a very consistent pattern that indicate a specific directionality to the value of the rel attribute. The only exception to this is the value "alternate", which, is actually inherently symmetric, so rel="alternate" means pretty much the same thing as rev="alternate". I say pretty much because in theory (and in practice) one of a pair of alternates is likely to be more definitive, and thus one is more a primary resource, with the other being an alternative. In theory you could extend rel with a new value, e.g. "original" which could be used to point back the original version of a document. This could be used for example with translations, where translations of a document would point back to the original with rel="original".

Are "rel" attributes, and linktypes in general, just document to document?

The vast majority of the rel values defined in HTML4 are from a document to a document. rel="stylesheet" is a bit of an exception, as it from an HTML document to a style sheet, which is more like a set of styling rules and instructions than a "document" in the classical sense. Two notable exceptions are rel="copyright" and rel="bookmark" which describe the relationship from the current document to (potentially) only part of a document. The 'rev' attribute adds an interesting perspective on this question. Specifically, 12.3.1 of HTML4 shows an example of two links one using rel and the other using rev which mean the same thing. Thus linktypes in general may be either from a whole document or part of a document to a whole document or a part of a document. For example, the RelTag specification introduces the rel="tag" value, and notes that it indicates a relation from a document or major portion thereof to a document. Finally, XFN probably stretches rel the farthest, as it uses rel to indicate a person to person relationship. This person to person scope was not introduced by XFN, but merely adopted. It was introduced by bloggers who have taken to linking to other bloggers by name and thus using people's blog URLs as proxies for people themselves.

Is/Was VoteLinks a proper use of rel?

No. The problem with using rel for VoteLinks is made apparent with the following example:

<a href="http://www2005.org" rel="vote-for">WWW2005 is a great conference</a>

Following the reasoning in the earlier answer to the question of what a rel value means, this link would mean: