HTML Manual


Home Page
HTML Tags
Table Tag
Image Tag
Anchor Tag and Linking
Character Attributes
Image Maps
Frames
Forms

 

Image Maps

  Image Maps are targets that are used on a web page that are used as a hyperlink. There are boundaries defined within an image map and when a user clicks within the boundaries, the hyperlink is activated. There are two types of image maps: server-side and client-side.

  In a server-side image map, the server, which is the computer that stores the Web page, controls the image map. So when the image map is clicked, the program running on the server activates the hyperlink. Server-side image maps are supported by most, if not all, graphical browsers. Server-side image maps can be slow to operate because every time the user clicks on the inline image, the request has to be processed by the Web server. The server handles the hotspots and not the Web browser therefore, no feedback is given regarding the location of the hotspots and their targets. However, these limitations can be overcome by using client-side image maps.

  In a client-side image map, you insert the image map into the HTML file. The image map is processed locally by the Web browser so you can easily test your pages using the HTML files. Client-side maps tend to be more responsive then server-side maps because information doesn't have to be sent over the network. When a user moves the cursor over the inline image, the browsers status bar will display the target of each hotspot. The disadvantage is that older browsers do not support them.

Top

Image Map Tags:

  The general syntax for an image map tag is:

          <MAP NAME="mapname">
          <AREA SHAPE=shape COORDS="coordinates" HREF="URL">
          </MAP>


  The <MAP> tag gives you the name of the image map. Within the <MAP> tag you use the <AREA> tag to specify the area of the image that will act as hotspots. You can include as many <AREA> tags as needed. The <AREA> tag has three properties: SHAPE, COORDS and HREF. The shape refers to the shape of the hotspot: RECT for rectangular, CIRCLE for circular and POLY for irregular polygons.

  The COORDS property, you enter the coordinates to specify the hotspots location. In the HREF parameter, you enter the URL for the hyperlink the hotspot points to.



Top