0

I know about HTML image maps

<map name="beachmap">
  <area href="/" shape="poly" coords="17,51,42,35,66,51,66,89,17,89"
    alt="Beach hut" title="Beach hut - where you get changed">
...

The units used, AFAIK, are pixels. I am in a situation where I need to create an image map, but on an image of variable width. Ideally, I'd like to create an image map that uses em, or percentages for area definitions instead of pixels. Is that possible? What are my options?

To be honest, I'm need to have image map functionality on a background which has background-sizing:cover set, so that's even more difficult. But if I could use relative units, or find an easy solution to have an image map for a variable-width image, it would be a great start already!

Rolf
  • 5,550
  • 5
  • 41
  • 61

1 Answers1

1

Found some similar questions or answers containing useful information ...

Resize image map on window resize

Dynamically resizing Image-maps and images

PS: specifications imply that percents might be used as image map unit, in addition to pixels, but it seems no browser follows that part of the specifications:

http://home.comcast.net/~urbanjost/IMG/semaphore.html

Community
  • 1
  • 1
Rolf
  • 5,550
  • 5
  • 41
  • 61