rev (HTML attribute)

Spec
Depr. Version
No HTML 2
Browser support (more…)
IE8 FF3.5 SA4 OP10 CH2
None None None None None

Syntax

rev=" { alternate | bookmark | chapter | contents | copyright | glossary | help | index | next | prev | section | start | stylesheet | subsection | other } "

Description

While the rel attribute defines the relationship of the referenced document or resource to the referencing document, the rev attribute is effectively the reverse of that: it defines the relationship that the referenced document would classify itself as having with this document. To use a simple example, let’s assume that our site has an index page containing references and links to a number of subsection pages. The index page could contain the following code, which identifies that the categories page is a subsection:

<link rel="subsection" href="categories.html"/>

In the categories page, you could have the following code:

<link rel="parent" href="index.html"/>

Now, these link elements only use the rel attribute, and you only see the complete pattern of parent page and subsection when you see both HTML snippets together, although, of course, they’re on separate pages. You can use the rev attribute to make clear the relationship between pages in both directions. Thus, the two snippets above become:

<link rel="subsection" rev="parent" href="categories.html"/>
<link rel="parent" rev="subsection" href="index.html"/>

Example

Here, the rev is used to identify the page as the parent for the categories page:

<link rel="subsection" rev="parent" href="categories.html"/>

Value

Refer to the syntax diagram for the acceptable predefined values for rev. Note, though, that you aren’t limited to these values: you can define your own rev attribute value, even though it won’t be of much use to any web browser. Why would you define your own value? You might be able to use that information for some other purpose—for example, querying or accessing the attribute’s value using JavaScript and the DOM.

Compatibility

Internet Explorer Firefox Safari Opera Chrome
5.5 6.0 7.0 8.0 1.0 1.5 2.0 3.0 3.5 1.3 2.0 3.1 4.0 9.2 9.5 10.0 2.0
None None None None None None None None None None None None None None None None None

The support charts indicate no support for this attribute, as none of the browsers do anything useful with it, or change the behavior of anything on the page as a result of it. The real value of adding a rev attribute is gained either from plugging in extra functionality to the page using JavaScript and the DOM, or through using a centralized web service of some kind that may be able to make use of the attribute’s content.

User-contributed notes

There are no comments yet.

Related Products