rel (HTML attribute)

Spec
Depr. Version
No HTML 3.2
Browser support (more…)
IE8 FF2 SA4 OP10 CH2
None None None None None

Syntax

rel="string"

Description

The rel attribute is used to provide information about the relationship between the document that’s being linked to (as defined in the href attribute) and the referencing document. An example of the kind of relationship between links is detailed in the Microformats XFN pattern.

One of the most common uses of the rel attribute, in the context of the a element, is to specify a value of "nofollow". This is to indicate to search engines that the linked document should not be indexed by the search engine, and that any reputation/value associated with the linking site is not passed on such that it benefits the linked page in search results. Nine times out of ten (if not all ten times!), this is related to Google’s Page Rank algorithm, and by adding a rel=”nofollow” in to the anchor it’s said to stop ‘Google Juice’ being passed on (Google explains how it handles nofollow links here). Other search engines may still follow links marked in this way, so you cannot assume that this is a fool-proof way of blocking pages from being searched and indexed.

Example

The following snippet shows a link to a friend’s web site, and uses the rel attribute to classify the linked page’s relationship to the page on which the link occurs. This example shows an attribute defined in the Microformats XFN pattern:

<p>I went over to <a href="http://www.djformat.com/"
    rel="friend">Matt</a>'s house. He was spinning some weird Cuban
    music for a mix he was putting together.</p>

Value

This attribute takes any value, or a series of space-separated values. Some conventions are beginning to form around the use of the rel attribute, as detailed in Microformats. One commonly-used value is "nofollow" (see description)

Compatibility

Internet Explorer Firefox Safari Opera Chrome
5.5 6.0 7.0 8.0 1.0 1.5 2.0 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

The support charts for this element show that no support is provided, as no browser renders the links that use this attribute any differently from normal links, nor does the application of rel change the browsers’ behavior in any way. The real value of the rel attribute is gained either by utilizing it to add functionality via JavaScript and the DOM, or through a centralized web service of some kind that may be able to make use of the attribute’s content (perhaps for analytical purposes, or for refining search results).

User-contributed notes

Related Products