Anatomy and Deployment of Links · Index · Part 1 · 2 · 3 · 4 · 5 · 6 · 7 · 8 · Expand · Web Feed


The LINK element can be used in the HEAD section only. It defines document relationships (META data) and has no content. For example LINK assigns style sheets to a document, it defines the position of the current document in a series, it provides information about printable or translated versions of the current document, it refers to RSS/ATOM feeds etc. etc.

The LINK syntax overview below omits some attributes, for a complete syntax compendium please refer to the W3C and the A element section of this tutorial.


Since LINK has no content, you must not use an end tag. Close LINK with a space followed by a slash: ' />'. LINK may be empty, it has no required attributes. For more detailed information please read the 'general notes on link syntax'.

Back



href specifies the fully qualified location of a related Web resource, for example an external style sheet or a feed. Examples:


<link href="http://www.domain.com/css/standard.css" rel="stylesheet" type="text/css" />

<link href="http://www.domain.com/css/800x600.css" title="Small Monitor" rel="stylesheet" type="text/css" />

<link href="http://www.domain.com/css/black-on-white.css" title="Black on white background" rel="alternate stylesheet" type="text/css" />

<link rel="alternate" type="application/rss+xml" title="Document title equals title of the RSS feed" href="http://www.domain.com/feeds/document-name.rss" />

<link rel="alternate" type="application/atom+xml" title="Document title equals title of the ATOM feed" href="http://www.domain.com/feeds/document-name.xml" />


For the persistent (default, 1st example) style sheet do not use the title attribute. For the preferred (2nd example) style sheet use title and put 'stylesheet' in rel. For alternate (3rd example) style sheets use title and put 'alternate stylesheet' in rel.

The 4th example tells user agents and search engines where the page's RSS feed is located. Some sites use type="application/rss+xml" for both RSS and ATOM feeds, if they provide only one of both formats. It seems to work due to feed autodiscovery applied at most places, but we don't recommend it. Better (5th example) specify the utilized format in type. At the time of writing, neither 'application/rss+xml' nor 'application/atom+xml' are registered media types, thus it's not guaranteed that all user agents will handle feed-URIs as expected.

Back



The title attribute in LINK usually gets used in conjunction with other attributes like href and rel to form an expression in valid syntax.

  • title is used together with the link type 'Alternate' or 'Alternate Stylesheet' to name user-selectable alternate style sheets.
  • In a link of the type 'Bookmark' to a key entry point within an extended document, the title attribute is used to label the bookmark.
  • In a link of the type 'Alternate' pointing to a translated version of the current document, or a version made up for another destination media (devices like 'screen', 'tty', 'tv', 'handheld', 'print' etc.), or a version delivered in another content type ('text/html', 'video/mpeg' etc.), title is used to put a human readable representation of the contents of hreflang|lang, media or type. Examples: 'This article in French', 'WAP version' or 'Watch the video'.

Back



The rel attribute describes the relationship from the current document to the resource specified by the href attribute. The value of this attribute is a space-separated list of link types. User agents, search engines, etc. may interpret these link types in a variety of ways. For example, user agents may provide access to linked documents thru a navigation bar, or print a series of related documents in their logical order. Search engines may link to alternate formats on their SERPs, or crawl and index resources which are not linked using an A element in the current document's BODY section. Here is a list of all link types defined by the W3C:

rel="Alternate" designates substitute versions for the document in which the link occurs. When used together with the lang attribute, it implies a translated version of the document. When used together with the type attribute, it implies a version delivered in another content format, for example RSS or ATOM. When used together with the media attribute, it implies a version designed for a different medium (devices like 'screen', 'tty', 'tv', 'handheld', 'print' etc.).

rel="Stylesheet"
Refers to an external style sheet. See the examples above and the manual on external style sheets for details. 'Stylesheet' is used together with the link type 'Alternate' for user-selectable alternate style sheets.

rel="Appendix" refers to a document serving as an appendix in a collection of documents.

rel="Bookmark" refers to a bookmark. A bookmark is a link to a key entry point within an extended document. The title attribute should be used to label the bookmark. Note that several bookmarks may be defined in each document.

rel="Chapter" refers to a document serving as a chapter in a collection of documents.

rel="Contents" refers to a document serving as a table of contents. Some user agents also support the synonym 'ToC' (from 'Table of Contents').

rel="Copyright" refers to a copyright statement for the current document.

rel="Glossary" refers to a document providing a glossary of terms that pertain to the current document.

rel="Help" refers to a document offering help (more information, links to other sources of information, etc.)

rel="Index" refers to a document providing an index for the current document.

rel="Next" refers to the next document in a linear sequence of documents. User agents may choose to preload the 'next' document, to reduce the perceived load time.

rel="Prev" refers to the previous document in an ordered series of documents. Some user agents also support the synonym 'Previous'.

rel="Section" refers to a document serving as a section in a collection of documents.

rel="Start" refers to the first document in a collection of documents. This link type tells search engines which document is considered by the author to be the starting point of the collection.

rel="Subsection" refers to a document serving as a subsection in a collection of documents.

Back



The rel and rev attributes play complementary roles and may be specified simultaneously. Although usually rev is not used in the LINK element, you could express the hierarchical position of a node as follows:


<link href="parent-node-URI" rev="parent" />
<link href="child-node1-URI" rel="child" />
<link href="child-node2-URI" rel="child" />
...


This construct would allow a spider to create a recursively ordered structure of a complex, hierarchial organized Web site, which is, caused by topical and hierarchical interlinking of nodes, not that easy to generate by following clickable links.



Web Site StructuringNext Page

Previous PageThe Components of a Link [HTML Element: A]


Anatomy and Deployment of Links · Index · Part 1 · 2 · 3 · 4 · 5 · 6 · 7 · 8 · Expand · Web Feed



Author: Sebastian
Last Update: September/7/2005 [1st DRAFT]   Web Feed

· Home

· Internet

· Link Tutorial

· Web Links

· Link to us

· Contact

· What's new

· Site map

· Get Help


Most popular:

· Site Feeds

· Database Design Guide

· Google Sitemaps

· smartDataPump

· Spider Support

· How To Link Properly


Free Tools:

· Sitemap Validator

· Simple Sitemaps

· Spider Spoofer

· Ad & Click Tracking



Search Google
Web Site

Add to My Yahoo!
Syndicate our Content via RSS FeedSyndicate our Content via RSS Feed



To eliminate unwanted email from ALL sources use SpamArrest!





neatCMS

neat CMS:
Smart Web Publishing



Text Link Ads

Banners don't work anymore. Buy and sell targeted traffic via text links:
Monetize Your Website
Buy Relevant Traffic
text-link-ads.com


[Editor's notes on
buying and selling links
]






Digg this · Add to del.icio.us · Add to Furl · We Can Help You!




Home · Categories · Articles & Tutorials · Syndicated News, Blogs & Knowledge Bases · Web Log Archives


Top of page

No Ads


Copyright © 2004, 2005 by Smart IT Consulting · Reprinting except quotes along with a link to this site is prohibited · Contact · Privacy