Change background of mapped image hotspot on mouseover

前端 未结 1 1119
伪装坚强ぢ
伪装坚强ぢ 2021-01-14 08:03

I have an image map of 3 polygons. The actual image hotspots are complex shapes consisting of multiple curves and edges.



        
相关标签:
1条回答
  • 2021-01-14 09:00

    aThis is an easy one.

    html:

    <img src="/images/map.gif" alt="HTML Map" border="0" usemap="#map" id="mappedImage" />
    

    css:

    img#mappedImage:hover {
        background: url("/images/map2.gif") no-repeat scroll 0 0 transparent;
    }
    

    Should do the trick. You could use the background-image: url("/images/map2.gif") as well - background provides more options at once like background-repeat, background-position etc.

    As for any questions about css I can recommend http://www.css4you.de/borderproperty.html as a good reference site with good examples.

    0 讨论(0)
提交回复
热议问题