HTML标签

HTML <map>标签

HTML <map>标签

HTML <map>标签与<area>标签一起使用以定义客户端图像映射。
图像地图由具有可点击区域的图像组成,您可以在其中单击图像,它将打开到新的或提供的目的地。
<map>标签可以包含多个<area>元素,这些元素定义区域的坐标和类型。
借助<map>标签,您可以轻松将图像的任何部分链接到其他文档,而无需分割图像。

语法

<map name=" ">
以下是有关HTML <map>标签的一些规范
支持
显示
开始标签/结束标签 空标签(仅开始标签)
用法 图片地图

示例

  <!DOCTYPE html>
<html>
 <head>
<title>HTML map tag</title>
<style>
  body{
  margin-left: 250px;}
</style>
  </head>
 <body>
 <h2>Example of HTML Map tag</h2>
<img src="image1.png" usemap="#web">
<map name="web">
<area shape="rect" coords="66,117,131,168" href="https://www.lidihuo.com/html/html-index.html">
<area shape="rect" coords="199,36,277,85" href="https://www.lidihuo.com/python/python-index.html">
<area shape="rect" coords="330,107,406,159" href="https://www.lidihuo.com/css/css-index.html">
<area shape="rect" coords="199,185,267,236" href="https://www.lidihuo.com/javascript/javascript-index.html">
 </map>
 </body>
</html>

属性:

标签专用属性:

属性 说明
name mapname 它定义图像映射的名称。

全局属性:

<map>标签支持HTML中的全局属性

事件属性:

<map>标签支持HTML中的事件属性。

支持浏览器

元素  chrome浏览器 浏览器  firefox浏览器 Opera浏览器  Safari浏览器
<map> 支持 支持 支持 支持 支持
昵称: 邮箱:
Copyright © 2022 立地货 All Rights Reserved.
备案号:京ICP备14037608号-4