Rediff Homepages
Home  
Tour | Feedback | Help | Report Abuse | Privacy Policy | Terms & Conditions  
Register or Sign In
WELCOME TO REDIFF HOMEPAGES
     What is rediff homepages?
     How do i get started?
     Start


    IT'S FREE. IT'S SIMPLE. IT'S FAST
     10 Mb free for life!
     Easy to remember address:
     members.rediff.com/nickname
     Ready to use templates
      Scan-A-Snap



 Cool Tools
Filemanager
File Manager
Template

Upload
Upload Your Site

 What Else

   Create a custom feedback form New

   Learn HTML with our Online Tutorial

   Download the entire tutorial zipped









 
Step 5 : Creating Links

Lets take a look at how we can create links to external pages, a mailto link and links within a document.



What is a Hyperlink?

A Hyperlink is a link or connection from one document to another, or to any resource, or within a document. The hyperlinked text is highlighted in some fashion. The default is usually blue, underlined text, but your display may vary. From now on whenever we refer to links we are refering to Hyperlinks.

Top



Creating a link using the <A HREF=></A> Anchor tags.

Let's make a link to Rediff.

First add the text for the links.

<BODY>
Go to Rediff!
</BODY>

Go to Rediff!

Then add a pair of anchor tags.

<BODY>
Go to <A>Rediff!</A>
</BODY>

And then finally add the URL with the HREF option. URL Stands for Universal Resource Locator. It is the address of the site you want to link to. In this case it is http://www.rediff.com

<BODY>
Go to <A  HREF="http://www.rediff.com/">Rediff!</A>
</BODY>

Go to Rediff!

You now have a link to the Rediff website on your page. Similiarly you can have links to any site you like as long as you know the URL (address).

Top


Creating a mailto using the <A HREF></A> Anchor tags.

The mailto link is used to give a link to an e-mail address. On clicking the link the browser opens a compose mail window with the mailto address.

Lets create a simple mailto link to homepages@rediff.co.in

<BODY>
Go to <A  HREF="mailto:homepages@rediff.co.in">
Rediff Homepages Email</A>
</BODY>

Here we replace the URL with mailto:emailaddress. The above example creates a mailto link to homepages@rediff.co.in. To see how it works click on the link below.

Rediff Homepages Email

Top


Creating a link within the document using the <A NAME=></A> tags.

To create a link within a document we follow two steps.
First we mark or name a location in the document with the <A NAME="NAME"></A> tags.

<BODY>
<A  NAME="THIS PLACE"></A>
</BODY>

Now that we have marked the place in the document we create a link to it.

<BODY>
<A  HREF="#THIS PLACE"></A>
</BODY>

Clicking on this link will take you to the part of the document where we have previously marked. Note that you can also link to a section of another external document.

<BODY>
<A  HREF="document.html#THIS PLACE"></A>
</BODY>

This link takes you to the 'THIS PLACE' mark within 'document.html'.

Top

Case Study : Ram Chandran's Homepage
You must be getting to know Ram Chandran pretty well by now. Here's how Ram tells you about his favorite links.
To view the code of the example file use the view source option of your browser.

< Formating Blocks Of Text | Index | Creating Inline Images >
Line
rediff.com
Disclaimer
© 1996 to 2001 rediff.com India Limited. All Rights Reserved.