1. To make an item in your page an "anchor" so that links can jump directly there, type <a name="[name of the anchor]" at the beginning of that text. Type </a> at the end of the anchor text. When coding the link from which you are jumping add #[anchor name] after the address of the page you are jumping to, adding "#[anchor name] after the ".htm" or ".html" in the address. 2. An anchor is a specific spot in your page for a link. This is useful when you want to direct your audience to a specific topic in a lengthy web page. For example, if you have been using the "Readings" link for these units, you may have noticed that when you click on "Readings" from topic 3 it takes you to that section of readings about topic 3. If you click on "Readings" from topic 5 it takes you to readings about unit 5. That is because the code for each unit's readings includes an anchor. For this unit, for example, the "Readings" link below is coded <a href="read.htm#unit5"> The final #unit 5 is the anchor. Similarly, if you check the links for subjects on the W3C resource, they all include anchors so that people can readily jump to the topic they need. 3. Using "ID" is useful so that you become accustomed to adding "ID" to elements. And you do not need to add that final </a> as when adding <a name>. This will be handy when we get to studying style sheets. However, in my experience, more browsers support "name" than support "ID" when it comes to anchors. 4. "../" in an address indicates that the computer should look in the directory above the one where the current web page is stored. Once your web site becomes complex, you may want to organize it into sub-directories, rather like sub-folders. Consider this example: the page you are working on is in a directory you have labelled "classwork" but you are keeping all your journal entries in a directory at the same site labelled "journal." If you want to include a link to a journal entry in the page kept in "classwork" your link will need to be something like: <a href="../journal/entryname.htm> |
|
Copyright by dwang, 1999. All rights reserved.