Site structure

This page is marked as In Progress so expect small errors or unfinished bits

When you link between pages it can be for many reasons. You are supposed to put the reason in the link so that the browser can act on that information.

rel and rev

These attributes are used inside an A tag:

<a href="fred.html" rel="next" >Next person</a>
        

This A shows the relationship between this document and the destination (next). That document (fred.html) might have a link back to this one with a REL attribute of "previous". It is also possible to have the opposite relationship defined. REV says what relationship fred.html has to this document and is placed in the link as well:

<a href="fred.html" rel="next" rev="previous" >Next person</a>
        

Another fairly common way of using these is:

<a href="fred.html" rel="section" rev="contents" >Fred</a>
        

This identifies the first page as a contents page and fred.html as one of the sections. You can also use SUBSECTION or CHAPTER in a similar way. In fred.html there may be a link back to the contents page:

<a href="people.html" rel="contents" rev="section" >Fred</a>
        

In these examples REV is not really needed as the REL in the other document provides the same information. REV would normally be needed when the object being linked to was not an HTML page (e.g. an image could not have a link back to the contents page.

These attributes make no difference to the user but can be used by browsers to provide extra navigation features.

link

Confusingly whilst an A tag provides a clickable hyperlink to another place there is also a LINK tag. This is used in the HEAD section to link a document to another object without a visible hyperlink.

<link title="Fred in French" type="text/html" hreflang="fr" rel="alternate" href="fred_fr.html" />
        

This example tells the browser that there is a related page. The page is in French and is an alternative to this page. This is useful for search engines as they can direct the searcher to a page in their language.

The same information can also be provided in the language of the destination page:

<link lang="fr" title="Fred en Francais" type="text/html" hreflang="fr" rel="alternate" href="fred_fr.html" />
        

Link can also be used to provide a link to a printable version of the page:

<link media="print" type="application/postscript" href="print.ps" />
        

Alternatively you can use a different stylesheet to format the page for printing.

submit to reddit Delicious Tweet