The Link element is a special HEAD element utilizing many of the same
attributes as the Hyperlink element [A].
It indicates a relationship between the current document and some other object.
A document may have any number of LINK elements which can indicate
authorship, related indices and glossaries, older or more recent
versions, document hierarchy, associated resources such as
style sheets, etc. Servers may also allow links to be added to a document
by those who do not have the right to alter the body portion of a document.
The popular browsers are just beginning to support this element,
which has been in the HTML specifications for some time.
Some uses for LINK Many of the following keywords are taken from the expired HTML 3.0
Draft. They describe a proposed standard set of relationships for use
in documents. Details of browser support and examples are further down.
REL=Alternate StyleSheet
References an external Style
Sheet[-->Index DOT Css] which can be used
to control the way the current document is rendered, but will not be used by
default if a "rel='stylesheet'" stylesheet is present and successfully
loaded. Browsers may present an interface to enable switching between
multiple stylesheets.
REL=Bookmark
These are used to provide direct links to key entry points into an
extended document. The TITLE attribute may be used to label the bookmark.
Several bookmarks may be defined in each document, and provide a means for
orienting users in extended documents.
REL=Copyright
References a copyright statement for the current document.
REL=Fontdef
References a downloadable font definition file.
REL=Glossary
References a document providing a glossary of terms that pertain to
the current document.
REL=Help
References a document offering help, e.g. describing the wider context
and offering further links to relevant documents. This is aimed at reorienting
users who have lost their way.
REL=Home
References a home page or the top of some hierarchy.
REL=Index
References a document providing an index for the current document.
REL=Next
References the next document to visit in a document structure or guided tour.
REL=Previous
References the previous document in a document structure or guided tour.
REL=Shortcut Icon
Associates an icon with the current page when favorite-d/bookmarked in your browser.
REL=StyleSheet
References an external Style
Sheet[-->Index DOT Css] which is used
to control the way the current document is rendered.
REL=ToC
References a document serving as a table of contents.
REL=Up
If the document is part of a hierarchy, this references the
immediate parent of the current document.
Defining document specific toolbars
[IE|M3|N7|O7]
The LINK element can be used to define a toolbar of navigation buttons or
an equivalent mechanism such as menu items. Many of the values for the REL
attribute could be reserved for this purpose (such as Home, Next, Previous, etc.)
Example: <linktitle="Here
is my home page"
rel="HOME"
href="myhome.htm" />
Link to an associated Style Sheet
[IE3B1|M|N4B2|O3.5]
The LINK element can be used with REL=StyleSheet to reference an external
Style Sheet which is used to control the way the current document is rendered.
The LINK element can be used with REL="Alternate StyleSheet" to reference additional
Style Sheet resources to use for the current document. An alternate stylesheet
may also be used if the REL="Stylesheet" stylesheet has trouble loading for
some reason.
The LINK element can be used with REL="SHORTCUT ICON" to associate an
icon image with the current page if it is bookmarked in a user's browser.
More information on this process can be found here.
This attribute indicates the URL of a document linked to the current document
through relationships established by the other attributes of this element.
Values:CDATA.
[Either an absolute or relative URL. All URLs should be URL encoded where required.]
Description:
This attribute is a keyword representing the intended rendering
destination for the style sheet definitions. Multiple destinations
are given delimited by commas.
Values: CDATA.
[Single or comma separated list of media keywords: screen [DEFAULT]
- style information should be used for rendering to computer screens. print - style information
should be used for rendering to page-centric devices, ie:
printed paper or print preview screen modes. projection - style information
should be used for rendering to transparent projected media devices. braille - style information
should be used for rendering to braille devices. speech - style information
should be used for rendering to speech synthesizers. all - style information
should be used for rendering to all devices.]
Description:
This attribute should specify methods to be used in accessing the
destination, as a whitespace-separated list of names. For similar
reasons as for the TITLE attribute, it may be useful to include the
information in advance in the link. For example, the browser may
choose a different rendering display (possibly a special icon) for a
destination that is searchable. None of the popular browsers ever
implemented this attribute and it has since disappeared from the
HTML 3.2 recommendation.
Values:
The set of applicable names is a function of the protocol scheme of
the URL in the HREF attribute.
The REV attribute is basically meant to be the same as the REL
attribute, but the semantics of the relationship are in the reverse
direction. A link from A to B with REL="X" expresses the
same relationship as a link from B to A with REV="X".
A LINK tag may have both REL and REV attributes.
Values:CDATA.
[A whitespace separated list of relationship names.]
Description:
This is an SGML Document Access
(SDA) attribute. SDA attributes are designed to transform HTML (and
other SGML-based documents) to the ICADD
DTD - which is used in creating accessible documents for users with
visual disabilities (rendering in Braille, large print, speech
synthesis, etc.) The attribute value specifies content to be added
BEFORE the original element content (in this case the string
"Linked to : #AttVal (TITLE) (URN) (HREF)")
when the SDA document is rendered (SDA also allows attributes and values
from the original element to be used in the new SDA element where necessary.)
"#AttVal (TITLE) (URN) (HREF)" references the values of the LINK
TITLE, URN and HREF attributes, respectively, if present.
Description:
This attribute suggests a title (advisory only) for the destination
resource. The TITLE attribute may be used for display prior to
accessing the destination resource, or for resources that do not
include titles (like graphics, plain text documents or Gopher menus.)
Description:
This attribute was originally meant to specify a more persistent
identifier for the NAME value of the LINK, but none of the popular
browsers ever implemented this attribute. It has since disappeared from
the HTML 3.2 recommendation.
Values: NA
Example
<html>
<head>
<title>Document
Title</title>
<linktitle="Here is my home page"
rel="HOME"
href="myhome.htm" />
<linkrel="STYLESHEET"
href="http://www.company.com/mystyles.css"
type="text/css" />
</head>
<body>
Document content goes here.
</body>
</html>
The Mosaic implementation of the LINK element is not widely supported,
even though many of the concepts for it have existed in HTML since
version 2.0. Its use does not harm a document in any way, but it would
be best not to rely on this as a sole navigation scheme until wider
support exists.
Remember to use the TYPE attribute in relation to the use of the LINK
element for Style Sheet purposes. With the advent of Netscape's Javascript
Accessible Style Sheets, it never hurts to be explicit as to which
style sheet language is being used.
The wide implementation of Style Sheets has begun with Internet Explorer 3.0
and has continued with its debut in Netscape version 4.0 and Opera 3.5.
These browsers represent the vast majority of the total browser market, so
use of CSS is not discouraged (it doesn't hurt that CSS is backward
compatible with non-CSS browsers.)
The use of "Screen" as the default media in HTML 4.x is in direct conflict
with the CSS standards. It should be "All."
Browser Peculiarities
Mosaic supports the LINK element in its 3.0 versions.
All LINK REL navigation relationships will be rendered in a separate
pane of the browser window.
IE 3.0 Beta 1 did not automatically register the
MIME type for Style Sheets, so if you're using a linked style sheet,
the server administrator on the user's site would have to register the
"text/css" type on the server. This problem was fixed in
later Internet Explorer versions.
Netscape 4.0 Beta 2 assumed a default MIME type for style sheets
to be 'text/javascript' for Javascript accessible style sheets. This was
fixed in beta 3 to the accepted 'text/css' default.
[Test]
Internet Explorer 4.0 and 5.0 only support the 'screen', 'print' and
'all' MEDIA attribute values.
[Test]
Netscape 4 supported only the 'screen' MEDIA attribute value. Netscape
6 appears to support the 'screen', 'print' and 'all' MEDIA attribute values.
[Test]
Opera 3.5 only supports the 'screen', and 'all' MEDIA attribute values.
[Test]
IE 3.0 only allowed for a single LINK or STYLE block. Only the last one
specified in the document is used. IE 4.0 and above, Netscape and Opera
merge/cascade multiple STYLE elements.
Although Internet Explorer 4.0 and above has access to the REV attribute
through the DOM, it does not appear to do anything with this information.
[Test]
Netscape 4.x ignores a LINKed stylesheet if the LINK element has an ID attribute.
Netscape's meager documentation on the SRC attribute says that the HREF
attribute takes precedence if both attributes are present.
I am not sure if Netscape 6 supports dynamic fonts as it did in Netscape
4.x. If it does not, then the SRC attribute is definitely not supported
in V6.0, since the other usage for SRC from 4.x (an alternate method
of specifying an HREF) is not supported in 6.0.
Netscape's meager documentation on the Mozilla site also mentions two
other attributes as valid: ARCHIVE and CODEBASE. I could not get either
of these attributes to behave as expected though.
Netscape 6+ presents a list of alternate stylesheets in its user
interface. The contents of the TITLE attribute are used for the display
name of each stylesheet.
Netscape 6+ presents the list of LINK types via a context menu (PC: right
click)...view page info...links tab. After Netscape 7, LINKs can be
presented directly in the user interface via the "site navigation bar."