Skip to: content, navigation

by Ian Lloyd

rel (HTML attribute)

Browser support full matrix
IE7 FF2 Saf3 Op9.2
None None None None
Spec
Depr. Version
No HTML 3.2
rel="string"

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>

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.

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

IE5.5None
6.0None
7.0None
Firefox1.0None
1.5None
2.0None
Safari1.3None
2.0None
3.0None
Opera9.2None

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

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

The Principles of Beautiful Web Design

Best Seller!

You don’t need to go to Art School to design great looking web sites!

Book Cover: The Principles of Beautiful Web Design

Download the FREE sample chapters