HTML <map> name 属性


实例

带有可点击区域的图像映射:

  1. <img src="planets.gif" width="145" height="126" alt="Planets" usemap="#planetmap">

    <map name="planetmap">
      <area shape="rect" coords="0,0,82,126" href="sun.htm" alt="Sun">
      <area shape="circle" coords="90,58,3" href="mercur.htm" alt="Mercury">
      <area shape="circle" coords="124,58,8" href="venus.htm" alt="Venus">
    </map>
运行一下 »

浏览器支持

Internet ExplorerFirefoxOperaGoogle ChromeSafari

所有主流浏览器都支持 name 属性。

定义和用法

name 属性是必需的,规定图像映射的名称。

name 属性与 <img> 标签的 usemap 属性相关联,以创建图像与映射之间的关系。

HTML 4.01 与 HTML5之间的差异

无。

语法

  1. <map name="mapname">

属性值

描述
mapname 图像映射的名称。