Lesson 7:Links


Links allow us to browse to another section of a web page, to view an in-line image, another page within a web site, or another web site in the Internet.

7.1 Text Link

The tags are

<a href="filename">text</a> for linking to a local file.
<a href="URL">Web site</a> for linking to another web site.

7.2 Graphical Link

The tags are just the same, but use an image in the place of text.

<a href="filename"><img src="image.jpg"></a>
<a href="URL"><img src="image.jpg"></a>

7.3 Email Link

This link allows users to email the person whose email address is specified in the link.
The tag is

<a href="mailto:liewvk8@pd.jaring.my">Email Me</a>

Now, copy and paste the codes below into your notepad and save the file as link.html.
 
<html>
<head>
<title>Links
</title>
</head>
<h1>This page contains various types of link</h1>
<hr>
<body background="back.gif" link=blue alink=green vlink=red>
<a href="image1.gif">Click to view image</a>
<br>
<a href="graphic.html">Click to view this web page</a>
<br>
<a href="http://www.yahoo.com">Yahoo!, the search engine</a>
<br>
<a href="http://members.tripod.com/~vkliew/vb.html">Visual Basic Tutorial</a>
<br>
<a href="image3.jpg"><img src="image2.gif"><a>
<a>
<a href="http://www.oocities.org/vkliew"><img src="image1.gif"></a>
<hr>
<center>
<a href="mailto:liewvk8@pd.jaring.my">Email Me</a>
</body>
</html>

Note: link=blue specified within the <body> tag means the link text will appear blue and vlink=red means the link text will appear red after a user has clicked on it(vlink actually means visited link). This is yet another parameter called alink which means active link that show the colour of the link text when a user is clicking on it.

Click here to view the sample output.

[Back to Main Page]