<map> 標(biāo)簽的 name 屬性的值是圖像映射使用的名稱,請參考下述示例:
實例
帶有可點(diǎn)擊區(qū)域的圖像映射:
<img src="planets.gif" width="145" height="126" alt="Planets" usemap="#planetmap">
<map name="planetmap">
<area shape="rect" coords="0,0,82,126" alt="Sun" href="sun.gif">
<area shape="circle" coords="90,58,3" alt="Mercury" href="merglobe.gif">
<area shape="circle" coords="124,58,8" alt="Venus" href="venglobe.gif">
</map>
<map name="planetmap">
<area shape="rect" coords="0,0,82,126" alt="Sun" href="sun.gif">
<area shape="circle" coords="90,58,3" alt="Mercury" href="merglobe.gif">
<area shape="circle" coords="124,58,8" alt="Venus" href="venglobe.gif">
</map>
嘗試一下 ?
瀏覽器支持
所有主流瀏覽器都支持 name 屬性。
定義和用法
name 屬性是必需的,規(guī)定圖像映射的名稱。
name 屬性與 <img> 標(biāo)簽的 usemap 屬性相關(guān)聯(lián),以創(chuàng)建圖像與映射之間的關(guān)系。
HTML 4.01 與 HTML5之間的差異
無。
語法
<map name="mapname">
屬性值
值 | 描述 |
---|---|
mapname | 圖像映射的名稱。 |

更多建議: