HTML and CSS Reference
In-Depth Information
The link in the above example, which points to an RSS feed, has two rel attribute values: "nofollow" and
"alternate." This tells browsers (and search engine spiders) two things. The first, "nofollow," is aimed at
search engine spiders. The second value, "alternate," implies that the linked document is an alternative
version of the current document. In this case, it's an RSS feed of the current document's content. If your
site is multilingual, any links to translated versions of the current page that you include should also use the
"alternate" rel attribute value.
At this point, it's worth pausing for a moment and discussing possible values for the rel attribute. In the
section on Link Types (available at www.w3.org/TR/html4/types.html#h-6.12), th e HTML 4 specification
details a number of recognized values for the rel attribute. In HTML 4, these were referred to as "link
types." According to the spec, "user agents, search engines, etc. may interpret these link types in a variety
of ways." The implication there is that interpretation of these values is left entirely to the browser, search
engine, or other software or device.
The following is a list of common rel attribute values:
alternate : Indicates that the linked document is an alternate version of the current document.
This value is frequently used to point to versions in different languages and syndicated versions
of a document (e.g. RSS or Atom feeds).
stylesheet : Specifies that the linked document is to be used as a stylesheet for the current
document. This value is almost universally used on the link element. In fact, the WHATWG's
HTML Living Standard only allows this attribute value on link elements.
nofollow : Implies that the author of the current document does not endorse the linked
document. Search engines, in turn, may not follow the link. The WHATWG's HTML Living
Standard only allows this attribute value on the a and area elements.
license : Indicates that the linked document contains information about the copyright or
ownership of the current document.
next or prev : Specifies that the linked document is the next or previous document in an ordered
series of documents. This value is frequently used on pagination links.
tag : Indicates that the link represents a tag that applies to the current document.
These are just a few possible values for the rel attribute. As the HTML5 specification does not enumerate
a list of potential values, the possibilities are endless. The WHATWG's HTML Living Standard, though,
provides a list of defined link types. That list is available at www.whatwg.org/specs/web-apps/cu rrent-
work/ multipage/links.html#linkTypes. Although the WHATWG's HTML Living Standard is not the same as
the W3C's official HTML5 specification, you should feel comfortable using the rel attribute values
described in the Living Standard.
Au revoir, rev attribute
In earlier versions of HTML, there existed a rev attribute that was, in effect, the opposite of the rel
attribute. The rev attribute was intended to describe an external document's relationship to the current
document. However, due to infrequent and often incorrect usage, the attribute is rendered obsolete in the
HTML5 specification.
 
Search WWH ::




Custom Search