HTML <img> ismap eigenschap

定义和用法

ismap The attribute defines the image as a server-side image map, this attribute is a boolean attribute.

An image map is an image with clickable areas.

When clicking on a server-side image map, the click coordinates are sent to the server in the form of a URL query string.

Note:Only when the <img> element is a descendant of an <a> element with a valid href attribute is it allowed ismap Properties.

See also:

HTML reference manual:HTML <map> tag

HTML reference manual:HTML <area> Tag

Example

Server-side image map:

<a href="/action_page.php">
  <img src="w3html.gif" alt="codew3c.com" ismap>
</a>

Try it yourself

Explanation

When the user clicks on a location on an ismap image, the browser automatically sends the x, y position of the mouse (relative to the top left corner of the image) to the server. Special server-side software (in this example, the demo_form.asp program) can respond based on these coordinates.

Syntax

<img ismap>

Browser support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support