Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

make hover effect on different parts of an image, not html but an img

Basically i have a "blueprint" for a building project,i need to make it so that when they hover on specific parts of the floor a short description pops out. something like this:enter image description here

like image 709
YejielIMP Avatar asked Jul 10 '17 07:07

YejielIMP


People also ask

How can I change the image on hovering?

This task can be simply done by using the CSS background-image property in combination with the :hover pseudo-class to replace or change the image on mouseover.

How do you hover a picture on another picture?

The best way to swap images on hover is to place both images in the same container, with the "rollover" image transparent by default. When the user hovers over the container, the "rollover" image becomes opaque. It is fast loading, easy to implement and works on all browsers.


1 Answers

You can use an Area Map. The syntax is as follows:

<map name="myMap">
  <area shape="rect" coords="0,0,10,20" href="somelink.html">
  <area shape="circle" coords="10,30,50,100" href="anotherlink.html">
</map>

You use the coords to define each area. You then can assign an ID to each area and make the hover items. Try it and let us know.

You can use an Image Map Generator online, there are plenty. I use this one: http://imagemap-generator.dariodomi.de/ It is much easier than doing it by your own.

like image 183
Jose Gomez Avatar answered Sep 18 '22 03:09

Jose Gomez