HTML <map> name 屬性
實例
帶有可點擊區域的圖像映射:
<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 屬性是必需的,規定圖像映射的名稱。
name 屬性與 <img> 標簽的 usemap 屬性相關聯,以創建圖像與映射之間的關系。
HTML 4.01 與 HTML5之間的差異
無。
語法
<map name="mapname">
屬性值
值 | 描述 |
---|---|
mapname | 圖像映射的名稱。 |
