HTML 5 <img> usemap 屬性
實(shí)例
帶有可點(diǎn)擊區(qū)域的圖像映射:
<img src="planets.gif" width="145" height="126" alt="Planets" usemap="#planetmap"
/>
<map id="planetmap">
<area shape ="rect" coords ="0,0,110,260" href ="sun.htm" alt="Sun" />
<area shape ="circle" coords ="129,161,10" href ="mercur.htm" alt="Mercury" />
<area shape ="circle" coords ="180,139,14" href ="venus.htm" alt="Venus" />
</map>
定義和用法
usemap 屬性將圖像定義為客戶端圖像映射。
圖像映射指的是帶有可點(diǎn)擊區(qū)域的圖像。
usemap 屬性與 map 元素的 name 或 id 屬性相關(guān)聯(lián),它建立了圖像與映射之間的關(guān)系。
HTML 4.01 與 HTML 5 之間的差異
無差別。
語法
<img usemap="#mapname" />
屬性值
值 | 描述 |
---|---|
#mapname | 井號(hào)(#) + 要使用的 map 元素名稱或 id |