Area shape in html

坚强是说给别人听的谎言 提交于 2019-12-24 19:28:10

问题


   <img src="demo_usa.png" width="960" height="593" alt="Planets" usemap="#planetmap">
      <map name="planetmap">
         <area shape="rect" coords="0,0,82,126" alt="Sun" href="#"onmouseover="this.style.backgroundColor='#00FF00';" 
        onmouseout="this.style.backgroundColor='transparent';"/>
     </map>

Where is the problem with onmouse over friends? I want to change the color when the mouse is over thea area shape Thx verry much


回答1:


An area element just specifies an area of an image, making it clickable. It does not set any rendering properties for that part of the image, so CSS settings on it are ignored.

To make the image change on mouseover, you need to use JavaScript code that replaces the entire image by a different one.



来源:https://stackoverflow.com/questions/20127935/area-shape-in-html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!