map標(biāo)簽的參數(shù)詳細(xì)介紹及使用示例

字號(hào):


    map標(biāo)簽定義一個(gè)客戶端圖像映射。圖像映射(image-map)指帶有可點(diǎn)擊區(qū)域的一幅圖像,下面為大家介紹下map標(biāo)簽的使用,感興趣的朋友可以了解下
    map標(biāo)簽必須成對(duì)出現(xiàn),即
    <map> ....</map>
    同時(shí)map必須和area配合使用。
    img標(biāo)簽里的usermap屬性值必須與map標(biāo)簽里的id和name值完全一致
    area標(biāo)簽:定義圖片的點(diǎn)擊區(qū)域 area 是單標(biāo)簽,不成對(duì)。
    屬性:
    accesskey 快捷鍵
    alt 圖片提示文字
    coords 定義和點(diǎn)擊區(qū)域的圖形的坐標(biāo)
    href 鏈接地址
    nohref 圖像點(diǎn)擊可排除的區(qū)域,當(dāng)不是有href時(shí),需要使用nohref
    shape 可點(diǎn)擊區(qū)域的形狀
    tabindex tab鍵遍歷
    target 鏈接目標(biāo)
    代碼實(shí)例:
    代碼如下:
    <img src="images/logo.gif" usermap="#map"/>
    <map id="map" name="map">
    <area shape="rect" coords="a,b,c,d" target="_blank" href=""/>
    <!-- a,b,c,d分別是矩形的左上角和右下角的坐標(biāo)值 !>
    <area shape="circle" coords="a,b" target="_blank" href="" />
    <!-- a,b分別是圓形的圓心的坐標(biāo)值 !>
    <area shape="poly" coords="a,b..." target="_blank" href="" />
    <!-- a,b分別是多邊形的各個(gè)定點(diǎn)的坐標(biāo)值 !>
    </map>