<area> 标签

定义和用法

<area> 标签定义图像映射中的区域(注:图像映射指得是带有可点击区域的图像)。

area 元素总是嵌套在 <map> 标签中。

注释:<img> 标签中的 usemap 属性与 map 元素 name 属性相关联,创建图像与映射之间的联系。

<img src="planets.jpg" border="0" usemap="#planetmap" alt="Planets" />
<map name="planetmap" id="planetmap">
<area shape="circle" coords="180,139,14" href ="venus.html" alt="Venus" />
<area shape="rect" coords="0,0,110,260" href ="sun.html" alt="Sun" />
</map>

注意:
usemap="#planetmap"将img和map进行绑定,shape、rect、href需要指定不然失去了 定义的意义; 

shape:指绘制的图形 如:矩形  圆 多边形
coords:图形的坐标

当shape="circle" 时,coords="x,y,r" 中心坐标(x,y)r 为半径

当shape="rect" 时,coords="x1,y1,x2,y2" 左上坐标(x1,y1)  (x2,y2)右下坐标

 

posted on 2015-09-30 11:49  源人  阅读(161)  评论(0编辑  收藏  举报

导航