日期:2014-05-17  浏览次数:20525 次

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

?

必需的属性

DTD 指示此属性允许在哪种 DTD 中使用。S=Strict, T=Transitional, F=Frameset.

属性描述DTD
alt text 定义此区域的替换文本。 STF

可选的属性

属性描述DTD
coords 坐标值 定义可点击区域(对鼠标敏感的区域)的坐标。 STF
href URL 定义此区域的目标 URL。 STF
nohref nohref 从图像映射排除某个区域。 STF
shape
  • default
  • rect
  • circ
  • poly
定义区域的形状。 STF
target
  • _blank
  • _parent
  • _self
  • _top
规定在何处打开 href 属性指定的目标 URL。 TF

?