Sams Teach Yourself HTML 4 in 24 Hours
- Table of Contents
- Copyright
- About the Author
- Acknowledgments
- Tell Us What You Think!
- Put Your HTML Page Online Today
- I. Your First Web Page
- Hour 1. Understanding HTML and XML
- Hour 2. Create a Web Page Right Now
- Hour 3. Linking to Other Web Pages
- Hour 4. Publishing Your HTML Pages
- II. Web Page Text
- Hour 5. Text Alignment and Lists
- Hour 6. Text Formatting and Font Control
- Hour 7. Email Links and Links Within a Page
- Hour 8. Creating HTML Forms
- III. Web Page Graphics
- Hour 9. Creating Your Own Web Page Graphics
- Hour 10. Putting Graphics on a Web Page
- Hour 11. Custom Backgrounds and Colors
- Hour 12. Creating Animated Graphics
- IV. Web Page Design
- Hour 13. Page Design and Layout
- Hour 14. Graphical Links and Imagemaps
- Hour 15. Advanced Layout with Tables
- Hour 16. Using Style Sheets
- V. Dynamic Web Pages
- Hour 17. Embedding Multimedia in Web Pages
- Hour 18. Interactive Pages with Applets and ActiveX
- Hour 19. Web Page Scripting for Non-Programmers
- Hour 20. Setting Pages in Motion with Dynamic HTML
- VI. Building a Web Site
- Hour 21. Multipage Layout with Frames
- Hour 22. Organizing and Managing a Web Site
- Hour 23. Helping People Find Your Web Pages
- Hour 24. Planning for the Future of HTML
- VII. Appendixes
- A. Readers' Most Frequently Asked Questions
- B. HTML Learning Resources on the Internet
- C. Complete HTML 4 Quick Reference
- D. HTML Character Entities
Using Named Anchors
Figure 7.1 demonstrates the use of intrapage links. To see how such links are made, take a look at the first <a> tag in Figure 7.1:
Figure 7.1 An <a> tag with a name attribute acts as a marker, so <a> tags with href attributes can link to that specific point on a page.
<a name="top"></a>
This is a different use of the <a> anchor tag; it simply gives a name to the specific point on the page where the tag occurs. The </a> tag must be included, but no text between <a> and </a> is necessary.
Now look at the last <a> tag in Figure 7.1:
<a href="#top">Return to Index.</a>
The # symbol means that the word top refers to a named anchor point within the current document, rather than to a separate page. When a reader clicks Return to Index, the Web browser displays the part of the page starting with the <a name="top"> tag.
Here's an easy way to remember the difference between these two different types of <a> tags: <a href> is what you click, and <a name> is where you go when you click there.
An anchor is a named point on a Web page. The same tag is used to create hypertext links and anchors (which explains why the tag is named <a>).
Similarly, each of the <a href> links in Figure 7.1 makes an underlined link leading to a corresponding <a name> anchor. Clicking the letter B under alphabetical index in Figure 7.2, for instance, takes you to the part of the page shown in Figure 7.3.
Figure 7.2 The <a name> tags in Figure 7.1 don't appear at all on the Web page. The <a href> tags appear as underlined links.
Figure 7.3 Clicking the letter B in Figure 7.2 takes you to the appropriate section of the same page.
Linking to a Specific Part of Another Page | Next Section

Account Sign In
View your cart