rel (HTML attribute)
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
| IE | 5.5 | None |
|---|---|---|
| 6.0 | None | |
| 7.0 | None | |
| Firefox | 1.0 | None |
| 1.5 | None | |
| 2.0 | None | |
| Safari | 1.3 | None |
| 2.0 | None | |
| 3.0 | None | |
| Opera | 9.2 | 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
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.

