<map>
备注: 这篇文章翻译不完整
HTML <map>
属性 与 <area>
属性一起使用来定义一个图像映射 (一个可点击的链接区域).
内容类别 (en-US) | 流式内容 (en-US),短语内容 (en-US),palpable 内容。 |
---|---|
允许的内容 | 任何透明 (en-US)元素。 |
标签省略 | 不允许,开始标签和结束标签都不能省略。 |
允许的父元素 | 任何接受短语内容 (en-US)的元素。 |
DOM 接口 | HTMLMapElement (en-US) |
属性
这个元素拥有全局属性 (en-US)。
name
-
name 属性 给 map 一个名字用来查询,这个属性是必须的,值必须不能为空并且不能带空格。name 属性不准与同文档中其他 map 元素的值相同,如果 id 属性也被添加,name 属性和 id 属性的值必须相同。
示例
html
<map name="example-map-1">
<area shape="circle" coords="200,250,25" href="another.htm" />
<area shape="default" />
</map>
结果
Expected live example output
The live example above should appear similar to the following images (when using your keyboard tab key):
For the left.html
link:
For the right.html
link
规范
Specification |
---|
HTML Standard # the-map-element |
浏览器兼容性
BCD tables only load in the browser