English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Referenzhandbuch

Vollständiges Verzeichnis der HTML-Tags

HTML: <map> Tag

Der HTML-<map>-Tag wird verwendet, um Bildkarten mit klickbaren Bereichen (oder Hotspots) zu definieren. Innerhalb des <map>-Tags kann der <area>-Tag verwendet werden, um klickbare Bereiche zu erstellen, und jeder klickbare Bereich kann eine mit ihm verbundene Hyperlink haben. Dieser Tag wird auch als <area>-Element bezeichnet.

Online-Beispiel

Bilder mit klickbaren Bereichen:

!DOCTYPE html>
<html>
<head> 
<meta charset="utf-8"> 
<title>Grundlagen-Tutorial-Website(oldtoolbag.com)</title> 
</head>
<body>
<img src="planets.gif" width="145" height="126" alt="Planeten" usemap="#planetmap">
 
<map name="planetmap">
  <area shape="rect" coords="0,0,82,126" alt="Sonnen" href="sun.html">
  <area shape="circle" coords="90,58,3" alt="Mercury" href="mercur.html">
  <area shape="circle" coords="124,58,8"alt="Venus" href="venus.html">
</map>
</body>
</html>
Testen Sie, ob ‹/›

Browserkompatibilität

IEFirefoxOperaChromeSafari

Most browsers currently support the <map> tag.

Definition and Usage Description

<map> Tag is used for client-side image maps. An image map is an image with clickable areas.

The usemap attribute of the <img> tag must be the same as the name attribute of the <map> tag to establish a relationship between these two elements.

The <area> element is always nested inside the <map> element. The <area> element can define an area in an image map.

HTML 4.01 with HTML5differences

Note: In HTML5 In, if the id attribute is specified in the <map> tag, then you must also specify the name attribute.

Differences between HTML and XHTML

In XHTML, the name attribute has been deprecated, and it is replaced by the id attribute.

attribute

attributevaluedescription
namemapnamerequired. For image-name specified by map

global attributes

<map> Tag supports global attributes, see the complete attribute table HTML Global Attributes.

event attributes

<map> Tag supports all HTML Event Attributes.