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
- What Are Frames?
- Creating a Frameset Document
- The <frame /> Tag
- Linking Between Frames and Windows
- Nested Frames
- Margins, Borders, and Scrolling
- Summary
- Q&A
- Workshop
- 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
Linking Between Frames and Windows
The real fun begins when you give a frame a name with the name attribute in the <frame /> tag. You can then make any link on the page change the contents of that frame by using the target attribute in an <a> tag. For example, Figure 21.3 includes the following tag:
<frame src="greeting.htm" name="main">
This displays the greeting.htm page in that frame when the page loads and names the frame "main".
In the top frame, listed in Figure 21.4, you will see the following link:
<a href="facts.htm" target="main"><img src="facts.gif" border=0 /></a>
When the user clicks this link, facts.htm is displayed in the frame named main (the lower frame). To accomplish this sort of interactivity before the invention of frames, you would have had to use complex programming or scripting languages. Now you can do it with a simple link!
If the target="main" attribute hadn't been included, the facts.htm page would have been displayed in the current (top) frame instead.
To save space, I haven't listed the facts.htm page in a figure; it's just a regular Web page with no special frame-related features. You can see what the top of it looks like in Figure 21.2, and you can see this whole frameset online at http://24hourHTMLcafe.com/hour21.
Nested Frames | Next Section

Account Sign In
View your cart