W3 3.2y
4.0y
NS 3.0n
4.0y
IE 3.0y
4.0y
TV 1.2y
2.1y

<LINK>

Description

The LINK element provides a way to link the current document to other related resources.

This element is only valid in the HEAD element.

DTD

<!ELEMENT LINK - O EMPTY               -- a media-independent link -->
<!ATTLIST LINK
  %attrs;                              -- %coreattrs, %i18n, %events --
  charset     %Charset;      #IMPLIED  -- char encoding of linked resource --
  href        %URI;          #IMPLIED  -- URI for linked resource --
  hreflang    %LanguageCode; #IMPLIED  -- language code --
  type        %ContentType;  #IMPLIED  -- advisory content type --
  rel         %LinkTypes;    #IMPLIED  -- forward link types --
  rev         %LinkTypes;    #IMPLIED  -- reverse link types --
  media       %MediaDesc;    #IMPLIED  -- for rendering on these media --
  >
from the HTML 4.0 DTD, "Copyright © W3C, (MIT, INRIA, Keio). All Rights Reserved."

Attributes

Core attributes: class id style title
Internationalization attributes: dir lang
Events: onclick ondblclick onmousedown onmouseup onmouseover onmousemove onmouseout onkeypress onkeydown onkeyup

W3 3.2n
4.0y
NS 3.0n
4.0n
IE 3.0n
4.0n
TV 1.2n
2.1n
CHARSET
This attribute specifies the character encoding of the resource to which the link points.
W3 3.2y
4.0y
NS 3.0n
4.0n
IE 3.0n
4.0y
TV 1.2y
2.1y
HREF
Specifies a URL designating the linked resource.
W3 3.2n
4.0y
NS 3.0n
4.0n
IE 3.0n
4.0n
TV 1.2n
2.1n
HREFLANG
This attribute specifies the base language of the resource where this link points to. The HREF attribute must be supplied when this attribute is present.
W3 3.2n
4.0y
NS 3.0n
4.0n
IE 3.0n
4.0n
TV 1.2n
2.1n
MEDIA
This attribute defines which medium should be used to render the document. The value is a comma-separated value of possible media. The default is "screen".
W3 3.2y
4.0y
NS 3.0n
4.0y
IE 3.0n
4.0n
TV 1.2y
2.1y
REL
The forward relationship also known as the "link type". It specifies a named relationship from the enclosing document to the resource specified by the HREF attribute.
HTML link relationships are as yet unstandardized, although some conventions have been established. Here are some proposed/used relationship values:

Value Description
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 media attribute, it implies a version designed for a different medium (or media).
Appendix Refers to a document serving as an appendix in a collection of documents.
Bookmark Refers to a bookmark. A bookmark is a link to a key entry point within an extended document. The title attribute may be used, for example, to label the bookmark. Note that several bookmarks may be defined in each document.
Chapter Refers to a document serving as a chapter in a collection of documents.
Contents Refers to a document serving as a table of contents. Some user agents also support the synonym ToC (from "Table of Contents").
Copyright Refers to a copyright statement for the current document.
Glossary Refers to a document providing a glossary of terms that pertain to the current document.
Help Refers to a document offering help (more information, links to other sources information, etc.)
Index Refers to a document providing an index for the current document.
Next Refers to the next document in an linear sequence of documents. User agents may choose to preload the "next" document, to reduce the perceived load time.

The WebTV browsers supports this value. Together with the HREF attribute, rel="next" specifies the web page that is likely to be the next page that the viewer will go to. The WebTV interface uses this information to prefetch the next page, storing its content in memory for a fast transition to the page when the viewer does select the link.

Use the HREF and rel="next" combination for likely next pages, giving viewers a feeling of even faster network performance. For example, if you are presenting a series of pages to the viewer, specify the HREF value and rel="next" so that the next page of the series can be loaded into memory as the viewer is still reading the current page.

This is the only value supported by WebTV.

Prev Refers to the previous document in an ordered series of documents. Some user agents also support the synonym "Previous".
Section Refers to a document serving as a section in a collection of documents.
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.
Stylesheet Refers to an external style sheet. See the section on external style sheets for details. This is used together with the link type "Alternate" for user-selectable alternate style sheets.
Subsection Refers to a document serving as a subsection in a collection of documents.


W3 3.2y
4.0y
NS 3.0n
4.0n
IE 3.0n
4.0n
TV 1.2n
2.1n
REV
This defines a reverse relationship. A link from document A to document B with rev="relation" expresses the same relationship as a link from B to A with rel="relation".
rev="made" is sometimes used to identify the document author, either the author's email address with a mailto URL, or a link to the author's home page.
W3 3.2n
4.0n
NS 3.0n
4.0y
IE 3.0y
4.0n
TV 1.2n
2.1n
SRC
The URL of the file that belongs to the link.
W3 3.2n
4.0y
NS 3.0n
4.0n
IE 3.0n
4.0n
TV 1.2n
2.1n
TARGET
The TARGET attribute forces the load of that link into the targeted window. The value supplied with the attribute must be the same as the name of the window, and is case-sensitive. You can give a window a name with the FRAME element. If a window with the supplied target name does not exists then a new window will be created with that name.
If you do not specify a target window the current window will be used, or the target specified with the BASE element.

Magic TARGET names
These names all begin with the underscore character. Any targeted window name beginning with underscore which is not one of these names, will be ignored.

Value Description
_blank This target will cause the link to always be loaded in a new blank window. This window is not named.
_self This target causes the link to always load in the same window the anchor was clicked in. This is useful for overriding a globally assigned BASE target.
_parent This target makes the link load in the immediate FRAMESET parent of this document. This defaults to acting like _self if the document has no parent.
_top This target makes the link load in the full body of the window. This defaults to acting like _self if the document is already at the top. It is useful for breaking out of an arbitrarily deep FRAME nesting.


W3 3.2n NS 3.0n
4.0y
IE 3.0y
4.0y
TV 1.2n
2.1n
TYPE
With rel="stylesheet" this attribute is used to identify the type of style sheets used. These are the supported values:
text/css
Used to indicate cascading style sheets.
text/javascript
This value is supported by Netscape Navigator 4.0 and indicates JavaScript style sheets. It is used for the implementation of Dynamic HTML in Netscape Communicator.

Examples

Source
Visit the <A href="LINK1.html">example page</A> which links to
an external style sheet.
 
Result
Visit the example page which links to an external style sheet.
Statistics