References

Beginner-friendly references for web development, with live, editable examples.

The HTML ismap attribute

Attribute All modern browsers Updated
Quick answer

The HTML ismap attribute turns the image into a server-side image map, sending the click coordinates to the server. It is used on an <img> that is a child of an <a> with an href.

Overview

The ismap attribute turns the image into a server-side image map, sending the click coordinates to the server. It applies to an <img> that is a child of an <a> with an href.

On click, the browser appends the pixel coordinates to the link URL (?x,y). It is legacy — client-side maps with usemap are almost always better.

Syntax

<a href="/map"><img src="map.png" ismap alt=""></a>

Values

Value
A boolean attribute — present or absent.

Best practices

  • Always give an <img> meaningful alt text (or empty alt="" if purely decorative).
  • Set width and height (or a CSS aspect-ratio) so the layout does not shift as images load.
  • Use srcset and sizes to serve appropriately sized images on each screen.
  • Add loading="lazy" to below-the-fold images.

Accessibility

Server-side image maps are not keyboard accessible and give no information about regions. Avoid them; use a client-side <map> with labeled <area> elements, or plain links.

Frequently asked questions

What does the ismap attribute do?
Makes an image a server-side image map.
How do I make images responsive?
Use srcset with sizes on the <img>, or a <picture> for art direction and modern formats.
How do I stop images causing layout shift?
Set the width and height attributes (or a CSS aspect-ratio) so the space is reserved.
Which elements use the ismap attribute?
It is an element-specific attribute, used on the <img> element (and <picture>).