Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html ie7中的:悬停事件问题_Html_Css_Internet Explorer 7 - Fatal编程技术网

Html ie7中的:悬停事件问题

Html ie7中的:悬停事件问题,html,css,internet-explorer-7,Html,Css,Internet Explorer 7,我有一张地图,上面绝对有几个div。每个div都有一个背景图像,其中包含一个文件中的正常状态和悬停状态。当用户将鼠标移到div上时,背景图像应该向上移动25个像素。在ie7中,背景图像向上移动了25个像素,但也向右移动了约20个像素 以下是CSS: #LosAngelesButton {position: absolute; top: 80px; left: 168px; background: url(../images/superNav/LosAngeles.png) no-repeat;

我有一张地图,上面绝对有几个div。每个div都有一个背景图像,其中包含一个文件中的正常状态和悬停状态。当用户将鼠标移到div上时,背景图像应该向上移动25个像素。在ie7中,背景图像向上移动了25个像素,但也向右移动了约20个像素

以下是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;}

这个问题只出现在ie7中。有什么建议吗?

我想你在其他浏览器中也有这个问题。您已经在#LosAngelesButton上设置了背景图像,并且当您将a悬停在该元素内时,无论它是什么,都会更改状态。我建议您在元素上设置原始背景位置


发布这个LosAngelesButton的HTML代码,我可以给你一个更精确的awnser

我想你在其他浏览器中也有这个问题。您已经在#LosAngelesButton上设置了背景图像,并且当您将a悬停在该元素内时,无论它是什么,都会更改状态。我建议您在元素上设置原始背景位置


发布此LosAngelesButton的HTML代码,我可以为您提供更精确的awnser

您所描述的不是
事件。它是
:hover
css伪类选择器。您所描述的不是
事件
。它是
:hover
css伪类选择器。