简体   繁体   English

:ie7中的:hover事件的问题

[英]Problem with a :hover event in ie7

I have a map with several divs positioned absolutely on the page. 我有一个地图,其中几个div绝对位于页面上。 Each div has a background image which contains the normal state and the hover state in one file. 每个div都有一个背景图像,该背景图像在一个文件中包含正常状态和悬停状态。 When the user mouses over the div, the background image is supposed to shift up 25 pixels. 当用户将鼠标悬停在div上时,背景图像应上移25个像素。 In ie7, the background image shifts up 25 pixels, but it also shifts to the right about 20 pixels. 在ie7中,背景图像向上移动了25个像素,但也向右移动了约20个像素。

Here is the CSS: 这是CSS:

#LosAngelesButton {position: absolute; top: 80px; left: 168px; background: url(../images/superNav/LosAngeles.png) no-repeat; height: 27px; width: 110px;}
#LosAngelesButton a {display: block; height: 27px; width: 110px; text-indent: -99999em;}
#LosAngelesButton a:hover {background: url(../images/superNav/LosAngeles.png) no-repeat 0 -25px;}

The problem is showing only in ie7. 该问题仅在ie7中显示。 Any suggestions? 有什么建议么?

I think you have this problem in other browsers to. 我认为您在其他浏览器中有此问题。 you have set the background image on #LosAngelesButton and you change the state when you hover the a inside this element whatever it is. 您已经在#LosAngelesButton上设置了背景图片,并且将鼠标悬停在此元素内部的状态更改了状态。 I would suggest you set your original background position on a element. 我建议您在元素上设置原始背景位置。

post the HTML code of this LosAngelesButton and i can give you a more precise awnser 发布此LosAngelesButton的HTML代码,我可以为您提供更精确的遮阳篷

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM