当前位置: 首页 > 网络学院 > 网页制作基础教程 > HTML > HTML <map> 标签

HTML
HTML Head
HTML Meta
HTML URLs
HTML Scripts
HTML 属性
HTML 事件
HTML URL-encode
HTML Web服务器
HTML 摘要
HTML 实例
标签列表
标准属性
事件属性
ASCII码
特殊字符
HTTP状态消息

HTML <map> 标签


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-03-04   浏览: 454 ::
收藏到网摘: n/a

定义与用法

Defines a client-side image-map. An image-map is an image with clickable regions.
定义用户端的图象热点。热点就是图片上可点击的区域


在HTML和XHTML中的区别

NONE

提示与注意点

Note: The area element is always nested inside the map element. The area element defines the regions in the image map.
注意:area元素要在map元素内使用。area元素可定义图象热点的区域

Note: The usemap attribute in <img> refers to the id or name (browser dependant) attribute in <map>, therefore we have added both the id and name attributes to <map>.
注意:在<img>中的usemap属性会指向在<map>里的idname属性,因此要在<map>中得将id和name属性都加上。


实例

代码 输出
<p>Click on one of the planets:</p>

<img src ="planets.gif"
width ="145" height ="126"
alt="Planets"
usemap ="#planetmap" />

<map id ="planetmap"
name="planetmap">
<area shape ="rect" coords ="0,0,82,126"
  href ="sun.htm" target ="_blank"
  alt="Sun" />
<area shape ="circle" coords ="90,58,3"
  href ="mercur.htm" target ="_blank"
  alt="Mercury" />
<area shape ="circle" coords ="124,58,8"
  href ="venus.htm" target ="_blank"
  alt="Venus" />
</map>

Click on one of the planets:
请点击下面的这张行星图:

Planets Sun Mercury Venus

 


必要属性

DTD indicates in which DTD the attribute is allowed. S=Strict, T=Transitional, and F=Frameset.
下表中的DTD列指明了被支持的DTD属性。S=Strict(精确的),T=Transitional(传统的),F=Frameset(框架)

属性 描述 DTD
id unique_name Defines a unique name for the map tag
定义map标签的唯一name
STF

可选属性

属性 描述 DTD
name unique_name Defines a unique name for the map tag (for backwards compability)
定义map标签的唯一name
STF

标准属性

class, title, style, dir, lang, xml:lang

For a full description, go to Standard Attributes.
查看完整的属性

事件属性

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

For a full description, go to Event Attributes.
查看完整的属性


尝试与演示

Create an image map
How to create an image map, with clickable regions. Each of the regions is a hyperlink.
如何建立带有可点区域的图象热点,并且每个区域都为超级连接

评论 (0) All

登陆 | 还没注册?