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
Documenting the Full Address of a Page
Suppose you create a Web page advertising your business, and a customer likes your page so much that she saves it on her hard drive. A couple of days later, she wants to show a friend your cool site, but guess what? She forgot to bookmark it, and of course the page doesn't contain a link to itself. She clicks the links to your order form, but they are only filename links (such as <a href="orderform.htm">); they don't work from her hard drive unless the order form is on her hard drive, too. You have lost two eager customers.
One way to avoid this heartbreaking scenario is to always use complete addresses starting with http:// in all links. However, this makes your pages difficult to test and maintain.
You could also include a link to your home page's full address on every page, including the home page itself. Yet there's a more elegant way to make a page remember where it came from.
The <base /> tag lets you include the address of a page within the <head> section of that page, like this:
<html><head> <title>My Page</title> <base href="http://www.myplace.com/mypage.htm" /> </head> <body> …The actual page goes here… </body> </html>
For the HTML authors whose job is to maintain this page, the <base /> tag provides convenient documentation of where this page should be put.
Even more importantly, all links within the page behave as if the page was at the <base /> address—even if it isn't. For example, if you had the page in Figure 23.7 on your hard drive and you opened it with a Web browser, all images on the page would be loaded from the online site at http://netletter.com/nicholas/ rather than from the hard drive. The links would also lead to pages in the nicholas directory at http://netletter.com, instead of pages on the hard drive.
Summary | Next Section

Account Sign In
View your cart