Back Main GuestBook Contact Music (JS) Appendix

<LINK> - Document Relationships

This element defines relationships between this document and another file. The tag appears in the document head, not the body, and is not rendered as part of the page. <LINK> is also used to link auxilary files to the HTML document--external style sheets and scripts, for example. Some browsers, notably Mosaic, create tool bars based on the document's <LINK> elements. <LINK> can also be used to provide other versions in different formats, in different languages, or for different media.

It is illegal to close this tag. </LINK> does not exist.

Attributes for <LINK>

  %coreattrs %il8n %events

  href= [CS]
Gives location.
This attribute gives the location of the linked document.

  charset= [CI]
Gives the character encoding type.
This attribute tells the browser what character encoding the linked document uses.

  hreflang= [CI]
Gives language code.
This attribute tells the browser what language the linked document is written in. (Human language.)

  type= [CI]
Gives file type.
This attribute tells the browser what type of file is linked. A few examples: "text/html", "text/javascript", "text/css"

  rel= [CI]
Gives a space separated list of link types (or just one).
This attribute defines forward link types, expressing the relationship of this document and the linked one.

  rev= [CI]
Gives a space separated list of link types (or just one).
This attribute defines reverse link types, expressing the relationship of this document and the linked one. I don't know the difference between forward and reverse link types.

  media= [CI]
Gives a comma separated list of media types.
This attribute tells the browser what sort of media the linked document is for so that it doesn't retrieve files it can't use. For instance, a graphical browser application won't need to retrieve files intended for a braille browser.

  target= [CS]
  • "__"
    [target name]
Don't forget to finish this!

Samples:

Linking to a stylesheet:
<LINK rel="stylesheet" href="styles.css" type="text/css" media="screen">

Linking to a table of contents:
<LINK rel="contents" href="../toc.html" type="text/html">

Linking to a translated version:
<LINK rel="alternate" href="JP/index.html" type="text/html" hreflang="ja-JP" charset="ISO-2022-JP">