带有可点击区域的图像映射(area)

带有可点击区域的图像映射:

<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="circle" coords="129,161,10" href ="mercur.html" alt="Mercury" /> <area shape="rect" coords="0,0,110,260" href ="sun.html" alt="Sun" /> </map>


标签:

  1、nohref:从图像映射排除某个区域。
  2、coords:属性规定区域的 x 和 y 坐标。coords属性与shape属性配合使用,来规定区域的尺寸、形状和位置。

   圆形:shape="circle",coords="x,y,z"这里的x和y定义了圆心的位置("0,0"是图像左上角的坐标),r是以像素为单位的圆形半径。
   
   多边形:shape="polygon",coords="x1,y1,x2,y2,x3,y3,..."每一对“x,y”坐标都定义了多边形的一个顶点(“0,0”是图像左上角的坐标)。定义三角形至少需要三组坐标;高纬多边形则需要更多数量的顶点。
       多边形会自动封闭,因此在列表的结尾不需要重复第一个坐标来闭合整个区域。

   矩形:shape="rectangle",coords="x1,y1,x2,y2"第一个坐标是矩形的一个角的顶点坐标,另一对坐标是对角的坐标,“0,0”是图像左上角的坐标。请注意,定义矩形实际上是定义带有是个顶点的多边形的一种简化方法。


原文地址:https://www.cnblogs.com/bigqipa/p/5853378.html