Skip to: content, navigation

rel (HTML attribute)

Spec
Depr. Version
No HTML 3.2
Browser support (more…)
IE7 FF2 Saf3 Op9.5
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.

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—it can even take a series of space-separated values. Some conventions are beginning to form around the use of the rel attribute, as detailed in Microformats.

Compatibility

Internet Explorer Firefox Safari Opera
5.5 6.0 7.0 1.0 1.5 2.0 1.3 2.0 3.0 9.2 9.5
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

ID:
#1
Contributed:
by dmwalk
Date:
Sat, 17 May 2008 17:58:27 GMT

Should have a discussion of nofollow here.

Add a note

To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.

Related Products

Search