Link relations
A link relation captures a relationship between two resources on the web. Each link relation has a link type that defines the type of the relationship.
HTML syntax
A link relation may appear as the rel attribute of an anchor <a/> element. According to the HTML 4.01 Specification, the rel attribute:
describes the relationship from the current document to the resource referred to by the
hrefattribute. The value of this attribute is a space-separated list of link types.
where a link type is a case-insensitive sequence of non white space characters.
Alternatively, a link relation may appear as the rel attribute of a link (<link>) element. The link element is an invisible equivalent of an anchor element which may only appear inside the head section (delimited by <head> and </head>) of a HTML document.
The anchor and link elements also have a rev attribute which may be used to capture a reverse relationship from the resource referred to by the href attribute to the current document.
Standards
The concept of link relations is defined by RFC 8288. The RFC refers to an IANA “Link Relation” registry where link relation types may be registered to avoid collisions.
RFC 8288 defines Extension Relation Types for link relation types that need not be registered with IANA. Such a link relation type is a URI under the control of the person or party defining the link relation type.
The HTML 4.01 Specification describes link relations for HTML. Although it introduces some link relation types that appear in the IANA Link Relation registry, the spec does not explicitly refer to the IANA registry. However, the IANA registry points to the HTML spec for the definitions of certain link relation types.
The following diagram shows the dependencies between these specifications.
RFC 8288 also defines a serialisation of link relations as part of the Link HTTP header. A Link HTTP header is semantically equivalent to a link HTML element and can be used by the browser to render a page more quickly by starting to dereference the link before processing the HTML payload.