html中的区域形状 [英] Area shape in html
本文介绍了html中的区域形状的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<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>
onmouse在朋友的问题
当鼠标悬停在区域形状上时,我想更改颜色
Thx多少
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
推荐答案
area
元素只是指定图片的一个区域,使其可点击。它不会为图像的该部分设置任何渲染属性,因此将忽略其上的CSS设置。
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.
要在鼠标悬停时更改图像,您需要使用JavaScript代码,用一个不同的图像替换整个图像。
To make the image change on mouseover, you need to use JavaScript code that replaces the entire image by a different one.
这篇关于html中的区域形状的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文