Attributo HTML <img> usemap

❮ Tag HTML <img>

Esempio

Una mappa immagine, con aree cliccabili:

<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>

Definizione e utilizzo

L' usemapattributo specifica un'immagine come mappa immagine lato client (una mappa immagine è un'immagine con aree selezionabili).

L' usemapattributo è associato <map> all'attributo name di un elemento e crea una relazione tra il <img>e il <map>.

Nota: l' usemapattributo non può essere utilizzato se l' <img>elemento è un discendente di un elemento <a>o . <button>


Supporto browser

Attribute
usemap Yes Yes Yes Yes Yes

Sintassi

<img usemap="#mapname">

Valori di attributo

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

❮ Tag HTML <img>