HTML 4 link Tag

Also see HTML5 <link> Tag.

This page contains information about the HTML 4 version of this element. For a more up to date version, see HTML5 <link> Tag.


The HTML link tag is used for defining a link to an external document. It is placed in in the <head> section of the document.

The HTML link tag is commonly used for linking to an external style sheet.

Despite its name ("link"), the link tag is not used for creating a hyperlink to another HTML document. If you need to link to another HTML document, use the HTML <a> tag.

Example

Attributes

Attributes specific to this tag:
AttributeDescription
none 
Other Attributes:
AttributeDescription
dirSpecifies the direction of the text
classDocument wide identifier.
idDocument wide identifier
langLanguage code
titleSpecifies a title to associate with the element. Many browsers will display this when the cursor hovers over the element (similar to a "tool tip").
styleInline style (CSS)
hrefSpecifies the URL of the resource document.
hreflangLanguage code of the destination URL
typeThe MIMEtype of content at the link destination
relDescribes the relationship between the current document and the destination URI.
  • alternate
  • appendix
  • bookmark
  • chapter
  • contents
  • copyright
  • glossary
  • help
  • home
  • index
  • next
  • prev
  • section
  • start
  • stylesheet
  • subsection
revDescribes a reverse between the destination URI and the current document. Possible values:
  • alternate
  • appendix
  • bookmark
  • chapter
  • contents
  • copyright
  • glossary
  • help
  • home
  • index
  • next
  • prev
  • section
  • start
  • stylesheet
  • subsection
targetSpecifies the target frame to load the page into. Possible values:
  • _blank
  • _self
  • _top
  • _parent
mediaSpecifies the device the document will be displayed on. Possible values:
  • all
  • braille
  • print
  • projection
  • screen
  • speech
charsetDefines the character encoding of the linked document.
onclickIntrinsic event (see event handlers)
ondbclickIntrinsic event (see event handlers)
onmousedownIntrinsic event (see event handlers)
onmouseupIntrinsic event (see event handlers)
onmouseoverIntrinsic event (see event handlers)
onmousemoveIntrinsic event (see event handlers)
onmouseoutIntrinsic event (see event handlers)
onkeypressIntrinsic event (see event handlers)
onkeydownIntrinsic event (see event handlers)
onkeyupIntrinsic event (see event handlers)

HTML5 Tags

The information on this page is based on HTML version 4.01. Most modern browsers now support HTML5, which is the next version of HTML after HTML 4.01.

See HTML5 <link> Tag for the HTML5 version of the above element.

Also see this list of HTML 5 tags for the latest version of HTML.