🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
# HTML &lt;map&gt; 标签 ## 实例 带有可点击区域的图像映射: ``` <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> ``` ## 浏览器支持 | IE | Firefox | Chrome | Safari | Opera | | --- | --- | --- | --- | --- | 所有主流浏览器都支持 &lt;map&gt; 标签。 ## 定义和用法 定义一个客户端图像映射。图像映射(image-map)指带有可点击区域的一幅图像。 ## HTML 与 XHTML 之间的差异 NONE ## 提示和注释: 注释:area 元素永远嵌套在 map 元素内部。area 元素可定义图像映射中的区域。 注释:&lt;img&gt;中的 usemap 属性可引用 &lt;map&gt; 中的 id 或 name 属性(取决于浏览器),所以我们应同时向 &lt;map&gt; 添加 id 和 name 属性。 ## 必需的属性 | 属性 | 值 | 描述 | | --- | --- | --- | | id | unique_name | 为 map 标签定义唯一的名称。 | ## 可选的属性 | 属性 | 值 | 描述 | | --- | --- | --- | | [name](/tags/att_map_name.asp "HTML &lt;map&gt; 标签的 name 属性") | _mapname_ | 为 image-map 规定的名称。 | ## 全局属性 &lt;map&gt; 标签支持 [HTML 中的全局属性](/tags/html_ref_standardattributes.asp)。 ## 事件属性 &lt;map&gt; 标签支持 [HTML 中的事件属性](/tags/html_ref_eventattributes.asp)。 ## 相关页面 HTML DOM 参考手册:[Map 对象](/jsref/dom_obj_map.asp "HTML DOM Map 对象")