Today we are going to look at an almost rare
HTML function called
<map> we use it to make a mapping selection of links for one image.
The downside to this is that there is no real feedback for a specific hover.
HTML Structure permalink
As you can see we define an image as usual, but give it the attribute
usemap="#image-map" this tells the image is needs to overlap with the map we are going to make below.
The map is called
image-map and has three areas we defined two rectangles for the Sky and the Ocean and a Polygon for the sand because it was a triangle where it touches the water.
I've used the following website to generate this map: image-map.
So if you now hover/click, you will see there are three separate links for the one image.
Cool right?! But as mentioned, it doesn't give proper feedback that they're three separate links, so UX wise debatable if it's the best solution. There are some
See this alternative way of making a multi clickable image with positioned elements.
Feel free to have a look at this Codepen.
Browser Support permalink
Supported by most modern browsers, and there are