link element
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 Example 2.
If you want to import a CSS file into another CSS file, use the @import at-rule.
If you want to see the HTML tags by categories, please visit this page.
This element cannot have a closing tag.
JavaScript page for this element: link. |
Possible members:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Example HTML code 1:
This example illustrates the use of the link element:
|
|||||
<head> <link rel="stylesheet" type="text/css" href="red.css" /> </head> <body> <div class="red">red division</div> <div>non-red division</div> <span class="red">red span</span> </body> |
|||||
|
|||||
Did you find this example helpful?
|
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 search engine. Note that the AddSearchProvider method provides similar functionality in JavaScript.
|
|||||
<head> <link rel="search" type="application/opensearchdescription+xml" href="searchProvider.xml" title="Dottoro Search" /> </head> <body> Please open the drop-down menu of your browser's Search Box. </body> |
|||||
|
|||||
Did you find this example helpful?
|
Related pages:
External links:
User Contributed Comments