HTML <map> 标签
html <map> 用于客户端图像映射,图像映射指带有可点击区域的一幅图像
<img> 中的 usemap 可引用 <map> 中的 id 或 name (取决于浏览器),所以我们应同时向 <map> id 和 name
<area> 元素永远嵌套在 map 元素内部,area 元素可定义图像映射中的区域
范例
带有可点击区域的图像映射
<img src="/static/i/img1.jpg" width="145" height="126" alt="Planets" usemap="#planetmap"> <map name="planetmap"> <area shape="rect" coords="0,82,126" alt="Sun" href="/static/i/html/sun.html"> <area shape="circle" coords="90,58,3" alt="Mercury" href="/static/i/html/sun2.html"> <area shape="circle" coords="124,8" alt="Venus" href="/static/i/html/sun2.html"> </map>
HTML 4.01 与 HTML5之差异
HTML5 中,如果 id 在<map> 中指定,则必须同样指定 name
HTML 与 XHTML 之差异
XHTML 中,name 已经废弃,使用 id 替换它