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
Mapping Regions Within an Image
To make any type of imagemap, you need to figure out the numerical pixel coordinates of each region within the image that you want to turn into a clickable link. An easy way to do this is to open the image with Paint Shop Pro and watch the coordinates at the bottom of the screen as you use the rectangle selection tool to select a rectangular region of the image (see Figure 14.4). When the mouse button is down, the coordinates at the bottom of the screen show both the top-left and bottom-right corners of the rectangle. When the mouse button isn't down, only the x,y position of the mouse is shown.
Figure 14.4 Paint Shop Pro can easily give the coordinates for imagemap regions without mucking about with special image-mapping utilities.
You could use the whole image in Figure 14.4 as an imagemap, linking to seven Web pages about the various literary genres. To do so, you would first need to decide which region of the image should be linked to each Web page. You can use rectangles, circles, and irregular polygons as regions. Figure 14.5 shows an example of how you might divide the image into these shapes.
Figure 14.5 Microsoft FrontPage 2000 lets you draw clickable hotspot links onto your imagemaps with your mouse.
To create the imagemap, first jot down the pixel coordinates of the top-left and bottom-right corners of each rectangular region shown in Figure 14.5. You also need to locate and record the center point and radius of the circle, as well as the coordinates of each corner of the irregularly shaped regions. (If you want to follow along with this by using an image of your own, just write the coordinates on a piece of paper for now. You'll see exactly how to put them into an HTML file momentarily.)
These coordinates are as follows:
- Fantasy (region 1): A rectangle from 15,15 to 220,100.
- Romance (region 2): A rectangle from 0,200 to 75,235 and a circle centered at 140,150 with radius 40.
- Horror (region 3): An irregular polygon with corners at the following eight points: (70,175), (90,155), (125,195), (160,195), (190,160), (220,185), (185,270), and (110,270).
- Sci-Fi (region 4): A rectangle from 225,10 to 330,120.
- Literary Fiction (region 5): A rectangle from 330,10 to 475,120.
- Action/Suspense (region 6): An irregular polygon with corners at the following five points: (230,130), (330,130), (330,270), (210,270), and (210,230).
- Mystery (region 7): A rectangle from 330,130 to 475,270.
Client-Side Imagemaps | Next Section

Account Sign In
View your cart