Links and Images
It seems that a major feature of Web pages is the fact that it contatins links to great websites, and colorful pictures. In this lesson, you'll learn how to place images and links into your documents.
Images
What we'll learn now is to place images to a Web page. To do this, use the IMG tag.
Links
Without links, your Web page would be pretty much useless. Most surfers want many links to get to what they're looking for.
You create links using the A tag.
<A> |
The A tag (which stands for "anchor") allows you to link to documents and parts of documents. First let's explain how to link to parts of documents. To put an anchor to a document, put this code in the area you want to link to:
<a name="name_of_anchor"></a>
For example, the top of this page has an anchor called "top". Click here to reach it.
Notice that the anchor is hidden. You can't see it, but you know it's there. Now, to link to this anchor,
type:
<a href="#name_of_anchor">
the text that will be the link, and the closing tag: </a>.
|
Example: |
Go to the top |
Source: |
<a href="#top">Go to the top</a> |
These are the links you'll see more often -- the links to other web pages. For instance, here's the link to Yahoo!. |
Example: |
Go to Yahoo! |
Source: |
<a href="http://www.yahoo.com">Go to Yahoo!</a> |
If you're linking a page on your own website, it'll be much different. If the file is on the same directory as the page with the link, just use the file for the link. This example is the Links page. Click on it, and then push your back button to go back to this page. |
Example: |
My Links page. |
Source: |
<a href="links.html">My Links page.</a> |
© 2001 Peter O.
|