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
- How and Why to Avoid Using Imagemaps
- Mapping Regions Within an Image
- Client-Side Imagemaps
- Server-Side Imagemaps
- Combined Client/Server Imagemaps
- Summary
- Q&A
- Workshop
- 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
How and Why to Avoid Using Imagemaps
The first thing I must say about imagemaps is that you probably won't need—or want—to use them! It's almost always easier, more efficient, and more reliable to use several ordinary images, placed right next to one another, with a separate link for each image.
For example, imagine that you wanted to make a Web page that looks like the one in Figure 14.1, with each of the glowing words leading to a different link. The obvious approach is to use a single imagemap for the entire central graphic. You'll see how to do that later this hour.
Figure 14.1 You can create this page using ordinary <img /> tags and <a href> links. Imagemaps aren't necessary.
However, the better solution is to cut the graphic into pieces by using Paint Shop Pro (or any other graphics program) and make each piece a separate image on the Web page. This way, the page is compatible with all versions of all Web browsers without requiring any server scripting or advanced HTML. Figure 14.2 shows how to cut the picture so that each link area is a separate image. Figure 14.3 shows the HTML that creates the page in Figure 14.1, using the images in Figure 14.2.
Figure 14.2 To avoid using imagemaps, you need to cut the image on the left into the seven images on the right. (Cut and paste using the rectangular selection tool.)
Figure 14.3 Using the images in Figure 14.3 is one way to implement the page in Figure 14.1. (The big image in Figure 14.3, links0.gif, isn't used.)
When would you want to use an imagemap, then? Only when the parts of an image you want to link are so numerous or oddly arranged that it would be a big hassle to chop the image into smaller images.
That does happen from time to time, so it's a good idea to know how to create imagemaps when you truly need to. The rest of this hour shows you how.
Mapping Regions Within an Image | Next Section

Account Sign In
View your cart