usemap定义一个客户端图像映射。图像映射(image-map)指带有可点击区域的一幅图像。
<img src="images/image_09.gif" width="202" height="310" border="0" usemap="#Map">
<map name="Map">
<area shape="rect" coords="28,45,114,63" href="add_affiche.php">
<area shape="rect" coords="29,71,114,90" href="search_affiche.php">
<area shape="rect" coords="29,96,184,115" href="intercept.php">
<area shape="rect" coords="29,122,138,140" href="page_affiche.php">
<area shape="rect" coords="28,146,114,165" href="update_affiche.php">
<area shape="rect" coords="29,171,117,189" href="delete_affiche.php">
area元素永远嵌套在map内部,area元素可定义图像映射中的区域。
上面这段源代码将这幅图映射为6个区域,当用户单击其中一个区域时,将链接到不同的文档。coords中的数据可以在
设计图中更改,不过前提是先随便写好代码中的任意数字,然后在设计视图中拖动即可。
usemap 属性提供了一种“客户端”的图像映射机制,有效地消除了服务器端对鼠标坐标的处理,以及由此带来
络延迟问题。通过特殊的 <map> 和 <area> 标签,HTML 创作者可以提供一个描述 usemap 图像中超链接敏感
域坐标的映射,这个映射同时包含相应的超链接 URL。usemap 属性的值是一个 URL,它指向特殊的 <map> 区
域。用户计算机上的浏览器将把鼠标在图像上单击时的坐标转换成特定的行为,包括加载和显示另外一个文档。