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
Workshop
Quiz
-
Modify the following Web page so that the Balzout Skydiving heading and fall.gif image drop into place together from above the top edge of the browser window. (Use the slide.js script presented in this hour.)
<html><head><title>Take a Dive</title> </head><body> <img src="diver.gif" align="left" width="100" height="200" /> <h1>Balzout Skydiving</h1> Join Richard Balzout for a free chute-packing lesson on June 15th at the Sewerside Memorial Airfield. </body></html>
- Now modify the page from Question 1 so that clicking the fall.gif image makes it leap back out of sight.
Answers
-
The following is one possibility. You could change the speed of the fall by adjusting the value of yhop. (This quiz answer is included in the online examples at http://24hourHTMLcafe.com/hour20, by the way.)
<html><head><title>Take a Dive</title> <script src="slide.js" language="javascript"> </script></head><body> <body OnLoad="if (checkDHTML()) { layername=makeName('ComeOnDown'); yhop=5; ygoal=10; xhop=0; xgoal=10; slide() }"> <div id="ComeOnDown" style="position: absolute; left: 10px; top: -210px"> <img src="diver.gif" align="left" width="100" height="200" /> <h1>Balzout Skydiving</h1></div> <div style="position: absolute; left: 10px; top: 220px"> Join Richard Balzout for a free chute-packing lesson on June 15th at the Sewerside Memorial Airfield.</div> </body></html> -
Replace the <img /> tag with the following:
<a href="#" OnClick="layername=makeName('ComeOnDown'); yhop=-10; ygoal=-210; xhop=0; xgoal=10; slide()"> <img src="diver.gif" align="left" width="100" height="200" border="0" /></a>
Exercise
- Try combining the techniques you learned in this hour with the JavaScript examples in Hour 19. For example, you might create a graphical meter by moving an image up and down on the page in response to a number entered in a form input box. The possibilities are endless, so grab your imagination and get creative!
VI. Building a Web Site | Next Section

Account Sign In
View your cart