map标签的参数详细介绍及使用示例


map标签必须成对出现,即

<map> ....</map>

同时map必须和area配合使用。

img标签里的usermap属性值必须与map标签里的id和name值完全一致

area标签:定义图片的点击区域 area 是单标签,不成对。

属性:

accesskey 快捷键

alt 图片提示文字

coords 定义和点击区域的图形的坐标

href 链接地址

nohref 图像点击可排除的区域,当不是有href时,需要使用nohref

shape 可点击区域的形状

tabindex tab键遍历

target 链接目标

代码实例:

复制代码
代码如下:

<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分别是矩形的左上角和右下角的坐标值 !>
<area shape="circle" coords="a,b" target="_blank" href="" />
<!-- a,b分别是圆形的圆心的坐标值 !>
<area shape="poly" coords="a,b..." target="_blank" href="" />
<!-- a,b分别是多边形的各个定点的坐标值 !>
</map>

« 
» 
快速导航

Copyright © 2016 phpStudy | 豫ICP备2021030365号-3