html 《area》标签

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

TIY
浏览器支持

所有主流浏览器都支持 <area> 标签。
HTML 与 XHTML 之间的差异

在 HTML 中,<area> 没有结束标签。

在 XHTML 中,<area> 必须正确地关闭。
提示和注释:

注释:<img> 中的 usemap 属性可引用 <map> 中的 id 或 name 属性(由浏览器决定),所以我们需要同时向 <map> 添加 id 和 name 两个属性。
必需的属性

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
标准属性

id, class, title, style, dir, lang, xml:lang, tabindex, accesskey

如需完整的描述,请访问标准属性。
事件属性

onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove,
onmouseout, onkeypress, onkeydown, onkeyup, onfocus, onblur

如需完整的描述,请访问事件属性。
TIY

创建图像映射
    本例显示如何创建带有可供点击区域的图像映射。其中的每个区域都是一个超级链接。

参考文献http://www.w3school.com.cn/tags/tag_area.asp

你可能感兴趣的:(html,area)