HTML <img> atribut usemap

❮ HTML tag <img>

Příklad

Obrazová mapa s klikacími oblastmi:

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

Definice a použití

Atribut usemapurčuje obrázek jako obrazovou mapu na straně klienta (obrázková mapa je obrázek s klikacími oblastmi).

Atribut usemapje spojen s <map> atributem name prvku a vytváří vztah mezi <img>a <map>.

Poznámka: Atribut usemapnelze použít, pokud je <img>prvek potomkem prvku <a>nebo <button>.


Podpora prohlížeče

Attribute
usemap Yes Yes Yes Yes Yes

Syntax

<img usemap="#mapname">

Hodnoty atributů

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

❮ HTML tag <img>