map

<map>

HTML <map> 属性 与 <area> 属性一起使用来定义一个图像映射(一个可点击的链接区域).

内容类别
允许的内容
标记遗漏没有,起始和结束标签都是强制性的。
允许父级任何接受短语内容的元素。
允许ARIA角色没有
DOM界面HTMLMapElement

属性

这个元素包含全局属性。

name

例子

<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="http://placehold.it/350x150" alt="350 x 150 pic">

例子

预期的现场示例输出

上面的实例应该与下面的图像类似(使用键盘标签键时):

对于 链接:left.html

对于链接:right.html

规范

SpecificationStatusComment
WHATWG HTML Living StandardThe definition of '<map>' in that specification.Living Standard
HTML5The definition of '<map>' in that specification.Recommendation
HTML 4.01 SpecificationThe definition of '<map>' in that specification.RecommendationInitial definition

浏览器兼容性

FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support1.0(Yes)1.0 (1.7 or earlier)1 5.0 (5.0)2 17.0 (17.0)3(Yes)1.01.0

FeatureAndroidEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support1.0(Yes)1.0 (1.0)1 5.0 (5.0)2 17.0 (17.0)3(Yes)1.01.0