Revision as of 02:18, 19 June 2005 by RyanKing (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)

Jump to: navigation, search


"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, such as RelLicense, RelTag, VoteLinks, and XFN.



Q: What is the proper use of the 'rel' attribute?

A: First, you can use the linktype as specified is HTML 4. A well known example of this is rel="stylesheet". Second, you "can extend the rel attribute using an profile", but "HTML doesn't specify/recommend a profile format". XMDP can be used to formally define new rel values.

Q: What does a rel value really mean?

A: 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.

Q: Then what does "rev" mean?

A: "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.

Q: is rel single or bi directional?

A: 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".

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

A: 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.

Q: Is/Was VoteLinks a proper use of rel?

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

<a href="" 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:

The resource indicated by is a "vote-for" the current document.

That clearly doesn't make any sense, and was certainly not the intent of VoteLinks. Ironically, the reverse makes a lot more sense:

The current document is a "vote-for" the resource indicated by

And generalizing to the same cultural usage links as XFN:

The current document, as a proxy for the person who wrote it (e.g. the blogger whose blog it is), is a vote-for the resource indicated by

Fortunately the "rev" attribute captures this "reverse" relationship semantic, and thus the above example should be written like this:

<a href="" rev="vote-for">WWW2005 is a great conference</a>

And thus VoteLinks has been changed to use "rev" instead of "rel", in order to keep the well known and easily understandable "vote-for", "vote-abstain", and "vote-against" values.

Q: When a 'rel' value refers to a relationship to or from a page or document, is it referring to just the page, or the contents of the page, or both?

A: The consensus (and convention) is that such rel values are referring to the page itself including its immediate contents, but not for example to embedded contents of like images, objects, frames etc.

rel-faq was last modified: Wednesday, December 31st, 1969