The Link Tag

ken's picture

Opening tag : <LINK>
Closing tag: -

Purpose:
The link tag is used to link the current document to external resources, such as stylesheets. The Link tag always appears in between the head tags. Another use of the link tag is to associate an icon with a page - which then appears in the address bar on some browsers.

Attributes:
Charset=characterset
- Specifies the character encoding of the linked to resource.

Dir=direction
- Useful for languages which need to be read from right to left.

Href=URL
- The address of the resource being linked to.

Hreflang=language
- The language of the linked page.

Id=Name
- Links like many other things can be given a unique ID.

Lang=Language
- Specifies the language of the text within the Link tag.

Media
- Indicates an alternative media used with the document

rel=type
- Specifies the type of the linked to page, for example 'stylesheet'.

Example:

<link rel="shortcut icon" href="/misc/favicon.ico" type="image/x-icon" />

Related Tags:

-

Back to:
Alphabetical Guide
Guide By Type