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
- Say you've made a picture of a button and named it button.gif. You also made a simple GIF animation of the button flashing green and white and named it flashing.gif. Write the HTML and JavaScript to make the button flash whenever someone moves the mouse pointer over it, and link to a page named gohere.htm when someone clicks the button.
- How would you modify what you wrote for question 1 so that the button starts flashing when someone moves the mouse over it, and keeps flashing even if he or she moves the mouse away?
- Write the HTML for a form that automatically calculates a total order cost, based on the number of widgets the user wants and a price of $25 per widget.
Answers
-
<a href="gohere.htm" OnMouseOver="flasher.src='flashing.gif'; OnMouseOut="flasher.src='button.gif'"> <img name="flasher" src="button.gif" border=0 /></a>
-
<a href="gohere.htm" OnMouseOver="flasher.src='flashing.gif'"> <img name="flasher" src="button.gif" border=0 /></a>
-
<html><head><title>widget order form</title> <script language="javascript"> <!-- function CalculateTotal() { document.orderform.total.value= parseInt(document.orderform.qty.value)*25} //--> </script></head><body> <form name="orderform" method="post" action="/htbin/generic"> Please send me <input name="qty" size=3 onblur="CalculateTotal()"> widgets at $25 each = TOTAL: <input name="total" size=5> <input type="submit" value="Order Now"> </form> <script language="javascript"> <!-- document.orderform.qty.value=0; document.orderform.total.value=0; //--> </script> </body></html>
Exercise
- Hey, what are you waiting for? Now that you're an HTML expert, get yourself a copy of the new Sams Teach Yourself JavaScript 1.3 in 24 Hours and take the next quantum leap in Web publishing!
Hour 20. Setting Pages in Motion with Dynamic HTML | Next Section

Account Sign In
View your cart