Browse By Name
HTMLCSSJavaScriptAppendix
You are here: Reference > HTML > tags > link

link element

A A Font size Print Content Add new content Share Share
Browser support:
Specifies a link to an external resource.
This element must be placed in the head section.
The link element allows authors to link external documents into the HTML document. Usually it is used to link external .css (style) files into the document. Another common use of the link tag is to identify an own or a specific search provider, as shown in the second example.
If you want to see the HTML tags by categories, please visit this page.
This element cannot have a closing tag.
If you want to use this element dynamically, visit the JavaScript page for this tag: link.

Possible members:

Attributes
Events
Styles
charset
Sets the character encoding of a linked document or a script block.
class
Sets the style class or classes that belong to the element.
dir
Sets the text direction as related to the lang attribute.
DISABLED
Sets the state of an object for user interaction.
href
Specifies the location of the destination.
hrefLang
Sets the language of a linked resource or anchor element.
id
Sets a unique identifier for the object.
lang
Specifies the language of the element.
media
Specifies the media types for style definition.
name
Sets the name of an element.
rel
Specifies the relationship between the current document and the destination of an anchor or link.
rev
Specifies a reverse relationship from an anchor or link to the current document.
style
Sets an inline style associated with an element.
target
Specifies the target window or frame where the document is to be opened.
title
Specifies a ToolTip for an object.
type
Specifies the content type (MIME type) of the object or the linked object.
xml:lang
Sets the language code of the XML document.

Example HTML code 1:

This example illustrates the use of the link element:
Code
style.css
<head>
    <link rel="stylesheet" href="style.css" type="text/css">
</head>
Did you find this example helpful? yes no

Example HTML code 2:

This example shows how to tell the client browser that you offer a search plugin from HTML. If the search provider is currently installed, it will be selected in the drop down menu of the Instant Search box.
Code
searchProvider.xml
<head>
    <link rel="search" type="application/opensearchdescription+xml" 
        href="searchProvider.xml" title="Dottoro Search" /> 
</head>
<body>
    Please open the search options of the Instant Search box in the menubar.
</body>
Did you find this example helpful? yes no

Related pages:

External links:

User Contributed Comments

Post Content

Post Content