What is an alternative to using image maps? I saw a question recently and someone said, "Why are people still using image maps?" and I wanted to know a good CSS or JavaScript solution to see for myself if its better to use than an image map.
CSS is the way to go when working with image maps. You can easily position a link with desired width and height over any area of the image by changing top left width height values.
In the example, Hover over the babies face or the red light in the image. To change the position of the anchors all you need to do is modify the top and left properties of #pos1 and #pos2. Same goes for width and height of the bounding box. All done with CSS with no javaScript.
you only need to put the ID's on the anchors, the divs are not required.
If your website is responsive, you might want to try using SVG as an excellent alternative to image maps.
SVGs can easily be made responsive and also respond to hover effects, etc.
This is a nice article that discusses the matter.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With