English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
usemap属性将图像指定为客户端图像图(图像图是具有可点击区域的图像),usemap属性与 <map> 元素的name属性相关联,并在 <img>和 <map>之间创建关系.
具有可点击区域的图像地图:
!DOCTYPE html <html> <head> <title>HTML:<img> usemap 属性 - 基础教程网 oldtoolbag.com</title> <body> <img src="planets.gif" width="145"height="126"alt="Planets" usemap="#planetmap"> <map name="planetmap"> <area shape="rect" coords="0,0,82,126"alt="Sun" 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>Prueba aquí ‹/›
IEFirefoxOperaChromeSafari
Todos los navegadores principales admiten la propiedad usemap.
La propiedad usemap especifica la imagen como una imagen de mapa de cliente (un mapa de imagen es una imagen con áreas clicables).
La propiedad usemap<map>La propiedad name del elemento está asociada y crea una relación entre <img> y <map>.
Nota: Si el elemento <img> es un descendiente del elemento <a> o <button>, no se puede usar la propiedad usemap.
Ninguna.
<img usemap="#mapname">
Valor | Descripción |
---|---|
#mapname | Un carácter de hash (#) seguido del nombre o id del elemento <map> que se utilizará. |