The HTML <link> tag

You must aware of HTML tags. There are several tags that define elements and linked resources of the web pages. Have you ever use the HTML link tag ? Its so stupid question but there is reason behind putting this question , The HTML link tag is very useful and amazing.

It has three main attribute

1. rel
2. type
3. href

The rel attribute define the relationship between page and linked web resource that could be a stylesheet, bookmark, alternate url and so on.


The type attribute define MIME(Multipurpose Mail Extension) of the web resource.


The href attribute define url of the web resource to be linked with page.



Syntax:

<link rel="Relationship" type="MIME Type" href="URL" / >

Here is the list of possible values of the rel attribute:

* alternate - an alternate version of the document(print page, translated/mirror)
* stylesheet - an external style sheet for the document
* shortcut icon - the fevicon of the document
* start - the first document in a selection
* next - the next document in the current selection
* prev - the previous document in the current selection
* contents - a table of contents for the document
* index - an index for the document
* glossary - a glossary (explanation) of words used in the document
* copyright - a document containing copyright information
* chapter - a chapter of a selection of documents
* section - a section of a selection of documents
* subsection - a subsection of a selection of documents
* appendix - an appendix of a selection of documents
* help - a help document
* bookmark - a related document

Note: Most browsers do not use this attribute in any way. However, search engines, and some browsers, may us this attribute to get more information about the link.

Linking a stylesheet with the page is one of most commonly used purpose of the HTML link tag. Here I'm going to show you more interesting uses of this tag.

Example 1:
This example with show a small icon in the browser's address bar before the URL

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

Example 2:
This example will show a RSS link in the browser's address bar after the URL

<link rel="alternate" type="application/rss+xml" title="RSS" href="http://www.mysite.com/rss.xml">


Example 3:
This example will show company's copyright information

<link rel="copyright" href="/copyright.shtml" title="Copyright">


Example 4:
This will link Author information with the page

<link rel="author" href="/about/index.shtml" title="About">


Example 5:
We can have link tag for many purposes

<HEAD>
<TITLE>Document Tags</TITLE>
<LINK REL=HOME TITLE="Home Page" HREF="http://www.mydomain.com">
<LINK REL=PREVIOUS TITLE="URLs" HREF="../urls/">
<LINK REL=NEXT TITLE="Lines and Paragraphs" HREF="../linepar/">
<LINK REV=MADE TITLE="Ravindra Patel" HREF="mailto:ravipatel.write@gmail.com">
<LINK REL=COPYRIGHT TITLE="copyright info" HREF="copyright.html">
<LINK REL=STYLESHEET TITLE="style sheet" HREF="stdstyles.css">
</HEAD>


There are much more on link tag. Post your comments if you want to know more about the HTML tags

0 Responses to "The HTML <link> tag"