KRIYA.jpg
HTML
 
Today Home      Visual Basic     HTML      Scripts
This week Feed Back
This Month Guest book
Lesson two


 
 
 

Home
Visual Basic
HTML
Scripts
MCP
 

Creating Links

1) Links to other files or pages
2) Mail links
3) Links to different parts of the same page

Linking to other files or pages
To create links, you use the Anchor <a>tag

<a href = "filename">anchor text</a>

In this example the "anchor text" is the visible part and on which the user clicks to get connected to the file 
click here  to see it in action.The code is 

<a href = "html.html">click here</a>

To dispaly an image in the Document use the "img src" tag
For example to dispaly the Title Kriya on the top of this page I made use of the following line of code

<img src = "title.jpg" alt = "kriya.jpg" >

Instead of "anchor text" you can maention an image with the img src parameter 

<a href = "filename"><img src = "image name"></a>

Now the image becomes a clickable link to the file.

2) Mail links
Following the same line of thinking you can create mail links, but there is a small difference. Let us examine one such link

<a href = mailto:\emailaddress>mail to<a>

would send a mail to emailaddress when you click on the text "mail to". You can substitute text with image as in the prevous example

3) Linking to a different location on the same page
If you observe carefully you will notice that to create a link we need a location to link to (specified by the href parameter) and a location to link from (whatever is between <a>and </a>)

Extending the same logic, let us create a link to the top of this page

<a href = "top">top</a>(of course this is not syntactially correct)

Well, the browser needs a location called "top" to link to. So we specify a location called top(obviously at the top of the page) using a variation of <a></a> tag

<a name = "top"> 

Now we have a place called "top" to link to. So let's link to it Properly

<a href = "#top">anchor text</a>

It is as simple as that and click below to see it working

back to top

Lesson No.3

This sight Is visited 10 times