Monday, 28 March 2011

Href Command

1. You already have an image used in your first page so lets now make that a link. We are going to make it link to "Page1.html"
2. The HTML code for an image link looks like this:
<a href="Page1.html"><img src="images/yourpichere.jpg"></a>
If you are linking to another website on the WWW then your link would look like this:
<a href="http:coll.merajnish@rediffmail.com><img src="images/yourpichere.jpg"></a>
For now though we are going to link your "index.html" file to your "Page1.html" file.
This is the code that needs to be placed in your "index.html" file
<a href="Page1.html"><img src="images/yourpichere.jpg"></a>
Remember to change the red text to the location of your pictue.
If your picture is in its own "Images" folder as discussed in a previous chapter then the obove code would be used.
If it is in the same folder as your "index.html" file then the following code would be used:
<a href="Page1.html"><img src="yourpichere.jpg"></a>

Here is what your code should now look like:
<html>
<head>
<title>My Own Home Page </title>
</head>
<body>
<body bgcolor= "yellow">
<font color="Red">
<H1> I am Your-Name and this is my web Page!</H1>
<a href="Page1.html"><img src="images/myimage.gif"></a>
<a href="Page1.html">Click Here for my next page</a>
</font>
</body>
Thats probably the easiest chapter in the book and shouldnt have taken you too long.

No comments:

Post a Comment