HTML Lesson 6

Goto Lesson:

Lesson 1
Lesson 2
Lesson 3
Lesson 4
Lesson 5
Lesson 6
Lesson 7
Lesson 8
Lesson 9
Lesson 10
Lesson 11
Throughout your everyday life you have probably heard the terms web site and web page. There is a difference in meaning of these two terms. a web page is simply one page, where as a web site is two or more pages weaved together using links. links are not a hard concept all they do is change the page that is being displayed in the browser. When a link is clicked on it changes the address in the address bar of your brower to point to the new page address. The command for making a link is simply <a>, unfortunately just putting in an a will not give you one. The option you need to make a link is the href option. The value of the href option will be the address to your page. This is where people get into some trouble. When you declare a link you are declaring a path to find the page and every / you type tells the browser to enter a new folder. Lets say you are saving all your webpages to a folder called web and you create a new folder called resources inside the folder web. You create a page in the web folder and you want the page to link to a page inside the resources folder called bibliography.html. Your href value to get from the file in the web folder to the file in the resource folder would be "/resources/bibliography.html" this tells the browser to go into resources then to go into bibliography.html and whatever this file is will displayed in the browser. If you were to link to a .exe it would be downloaded instead of displayed so you must make sure you include your file extension. Now lets say you want a link on the page bibiliography that links back to the web folder to a file called index.html. To do this we are going to have to use a special path command that will take us back one folder (../). Our href value would look like this "../index.html" this would take us back out of the resources folder and into the folder and then into index.html. That is how you link to files in your own computer, but you must also know how to link to other sites from yours. To do this you must leave your server. To do this you are first going to enter the protocol you are going to (usually http:// or maybe ftp://) then you would type the address to the system with the page you are going to. The address to a system is a group of four numbers (called an IP address), but this would be difficult to remember so names have been given to these sites to make them easier to find. If I wanted to link to www.google.com I would make my href value equal "http://www.google.com" or if I wanted i could use the IP address "http://216.239.39.147" and these would take me to the same place. Try typing in and saving the examples below if you are not following the preceding explanation.

<html>
<head>
<title>Our index page</title>
</head>
<body>
To go to our bibiliography <a href="resources/bibliography.html">click here</a>.
</body>
</html>

Save this page as index.html
then create a new folder inside the same folder that index.html is saved in and name it resources.
Then create this page and save it as bibliography in the resources folder.

<html>
<head>
<title>bibliography page</title>
</head>
<body>
This is our bibliography, to go back to our index page <a href="../index.html">click here</a>.
</body>
</html>


And that is all there is to links. Congratulations you have mastered the basics of web programming. Now will make our pages start to look like real pages in the next lesson.