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 >

<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>

相关文章:

  • 2021-07-11
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2023-03-19
  • 2022-12-23
  • 2022-12-23
  • 2022-02-21
猜你喜欢
  • 2021-10-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-31
相关资源
相似解决方案