HTML <img> usemap- Attribut

❮ HTML <img>-Tag

Beispiel

Eine Imagemap mit anklickbaren Bereichen:

<img src="workplace.jpg" alt="Workplace" usemap="#workmap" width="400" height="379">

<map name="workmap">
  <area shape="rect" coords="34,44,270,350" alt="Computer" href="computer.htm">
  <area shape="rect" coords="290,172,333,250" alt="Phone" href="phone.htm">
  <area shape="circle" coords="337,300,44" alt="Cup of coffee" href="coffee.htm">
</map>

Definition und Verwendung

Das usemapAttribut gibt ein Bild als clientseitige Imagemap an (eine Imagemap ist ein Bild mit anklickbaren Bereichen).

Das usemapAttribut ist mit dem Namensattribut eines <map> Elements verknüpft und stellt eine Beziehung zwischen dem <img>und dem her <map>.

Hinweis: Das usemapAttribut kann nicht verwendet werden, wenn das <img>Element ein Nachkomme eines <a>or - <button>Elements ist.


Browser-Unterstützung

Attribute
usemap Yes Yes Yes Yes Yes

Syntax

<img usemap="#mapname">

Attributwerte

Value Description
#mapname A hash character ("#") plus the name of the <map> element to use

❮ HTML <img>-Tag