HTML
<map>
element
用于
<area>
元素以定义图像映射 (可点击的链接区域)。
| 内容类别 | 流内容 , 措词内容 ,可触及内容。 |
|---|---|
| 准许内容 | 任何 transparent 元素。 |
| Tag omission | None, both the starting and ending tag are mandatory. |
| Permitted parents | Any element that accepts 措词内容 . |
| Implicit ARIA role | 无对应角色 |
| Permitted ARIA roles |
No
role
permitted
|
| DOM 接口 |
HTMLMapElement
|
此元素包括 全局属性 .
名称
名称
attribute gives the map a name so that it can be referenced. The attribute must be present and must have a non-empty value with no space characters. The value of the
名称
attribute must not be a compatibility-caseless match for the value of the
名称
attribute of another
<map>
element in the same document. If the
id
attribute is also specified, both attributes must have the same value.
<map name="primary"> <area shape="circle" coords="75,75,75" href="left.html"> <area shape="circle" coords="275,75,75" href="right.html"> </map> <img usemap="#primary" src="https://placehold.it/350x150" alt="350 x 150 pic">
The live example above should appear similar to the following images (when using your keyboard tab key):
对于
left.html
link:
对于
right.html
link
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
map
|
Chrome 完整支持 1 | Edge 完整支持 12 |
Firefox
完整支持
1
注意事项
|
IE 完整支持 Yes | Opera 完整支持 Yes | Safari 完整支持 1 | WebView Android 完整支持 1 | Chrome Android 完整支持 18 | Firefox Android 完整支持 4 | Opera Android 完整支持 Yes | Safari iOS 完整支持 Yes | Samsung Internet Android 完整支持 1.0 |
名称
|
Chrome 完整支持 1 | Edge 完整支持 12 | Firefox 完整支持 1 | IE 完整支持 Yes | Opera 完整支持 Yes | Safari 完整支持 1 | WebView Android 完整支持 1 | Chrome Android 完整支持 18 | Firefox Android 完整支持 4 | Opera Android 完整支持 Yes | Safari iOS 完整支持 Yes | Samsung Internet Android 完整支持 1.0 |
完整支持
见实现注意事项。