Linking Objects














Linking Objects

Linking Object together is the next lesson in this html tutorial. What is linking pages and objects together? It is simply connecting one page to another. If you look to the left of this screen you see that I've linked this one little lonely page with all those other pages. Soooo, how do we do this? Let me show you the command first:

Example 3:
<a href="home.htm">Home</a>

Now what does this mean? Let me take you step by step, because this can be confusing, and my first mistake when I started making web pages came at this point. The A part of <A href=> means anchor, it is in charge of anchoring the word home, notice how it is placed between the two tags. This will make the word Home, the anchor word, or the hyperlink on your web page. href in this tag means, hypertext reference, now, it has an = sign, and then has "home.htm" and then a > closing off this tag. When you upload your web pages to where ever your home page will be stored, you must upload all the files into one folder. If you notice that all the files for this web page that I wrote resides in the folder html. The reason that this must be done is because the <a href="home.htm"> will look only in the folder that you stored your pages in.

Okay, so now you can link all the pages that you write together, but what if you want to link to a friends page? What if you want to create a link to a webpage outside your web page? Say you think this web page that I've written is so wonderful that you just have to link it to your site, what would you do? You would do this:
<a href="http://members.aol.com/pennypat/html/home.htm">My Friends Page</a>
Now, everything looks exactly the same, accept instead of the a href command looking just in the folders that you saved your webpage, it will make your page go to my page, because you've used the URL (universal resource locator) to my page. With this command you can link to any number of pages you want to, all you do is put the url for that person (the web address for that web page). This is helpful if you want to link your pages to friends, or webpages that you like and may want the visitors to your site to visit. Whenever using the <a href=> make sure to close it with the </a> otherwise the hyperlink will not be created on your page. You can also use an image to link one site to the next, but I'll explain how to do that in the image section of this tutorial.

Now, how would you use the <a href> to link to an email? We've all clicked on the email me links on web pages, so this is how you would do that:
<a href="mailto:youraddress@aol.com">Email me</a>
Now, this basically tells a web browser to open a persons email account, and to insert this email address into the send spot. As an example, Email me now when you click on this you'll be able to send me an email. Try it if you want, I would love to hear from you.

Linking to an object on one web page!

Now if this were a very long page, perhaps one that went well past the length of the window of your screen, you could link to an object on this page. As an example, I've linked the bottom of this page to the top, just click back to linking objects
Now that you've scrolled back to here, how did I do that? Magic? No, just linking. Here is how it works. At the top of the page, I used this tag around the words, Linking Objects, I put this:
<a name="top">Linking Objects</a>

Now this doesn't create a visible hyperlink, what it does is say, I've named these words "top" and when you see this link: <a href="#top">Back to top</a> you should go back to that location. You can name the object anything you want, I just picked "top" just because and also the words back to top, etc, you can change to whatever best suits you. So, now that you have this power to link all over the place, use the power!! Practice and try it out. Just carefully follow all the instructions that I've listed.

Now on to the next lesson: Images!