【发布时间】:2012-09-18 05:08:09
【问题描述】:
这是一个顽固的人。
我有一个打开视频播放器的链接(见下文)。同位素水文图片为链接图片,播放按钮图片在span内作为背景图片。
我正在使用 css sprite,因此当有人将鼠标悬停在图像的任何部分上时,播放图像将变为下面的内容。
这在除 IE 之外的所有浏览器中都可以正常工作。在 IE9 中,当我将鼠标悬停在同位素水文图像上时,它会改变颜色并且可以点击(如上图)。但是当我将鼠标悬停在实际的播放按钮上时,它会从蓝色的“活动”播放按钮(上图)切换到灰色的“非活动”播放按钮(上图),并且不可点击。
我创建了下面的图片来说明正在发生的事情:
这是当您将鼠标悬停在同位素水文图像上时(这是我想要发生的)
一旦我将鼠标悬停在播放按钮(这是一个跨度背景图像)上,它就是这个样子。(光标变为文本光标,css sprite 变回非悬停颜色)
对此的任何帮助都会很棒。
这里是html:
<div id="news-video" class="news-tab">
<div id="video-box-left">
<div class="video-img">
<a href="#" onclick="window.open('http://wwwindex.html','photoessay','scrollbars=no,resizable=yes,width=850,height=722')"><span class="video-play-q-left">play</span><img src="resources-na/images/video-amano-scientific-forum.PNG" alt="Isotope Hydrology - The Fingerprints of Water" width="200" height="155" border="1"></a>
</div>
<div class="video-text">
<p><strong>Food for the Future - Meeting Challenges with Nuclear Applications - Statement to 2012 Scientific Forum</strong><a href="#" onclick="window.open('http://www-','photoessay','scrollbars=no,resizable=yes,width=850,height=722')"></a></p>
</div>
</div>
<div id="video-box-right">
<div class="video-img">
<a href="#" onclick="window.open('http://www-','photoessay','scrollbars=no,resizable=yes,width=800,height=600')"><img src="resources-na/images/video-isotope-hydrology.jpg" alt="Isotope Hydrology - The Fingerprints of Water" width="200" height="155" border="1"><span class="video-play-q-right">play</span></a>
</div>
<div class="video-text">
<p><strong>Isotope Hydrology - The Fingerprints of Water</strong><a href="#" onclick="window.open('http://.html','photoessay','scrollbars=no,resizable=yes,width=850,height=722')"></a></p>
</div>
</div>
这是css:
#news-video {
color: #8A8A8A;
font-size: 1.1em;
line-height: 1.6667;
padding-left: 0px;
}
#video-box-left{
margin-left: 10px;
margin-right: 20px;
float: left;
width: 210px;
}
#video-box-right{
margin-right: 10px;
float: left;
width: 210px;
}
.video-img {
background-color: #EEEEEE;
border: 1px solid #DDDDDD;
margin-bottom: 5px;
padding: 4px;
width: 200px;
height: 155px;
}
.video-text {
}
.video-play-q-left {
background: url("../images/video-play-q-big.png") no-repeat scroll 0 0 transparent;
background-position: center top;
height: 50px;
position: absolute;
text-indent: -9999em;
width: 50px;
left: 100px;
top: 127px;
}
.video-play-q-right {
background: url("../images/video-play-q-big.png") no-repeat scroll 0 0 transparent;
background-position: center top;
height: 50px;
position: absolute;
text-indent: -9999em;
width: 50px;
left: 321px;
top: 127px;
}
a:hover .video-play-q-right{
background-position: center bottom;
}
a:hover .video-play-q-left{
background-position: center bottom;
}
【问题讨论】:
-
你能在 jsfiddle 中创建一个工作示例吗?
-
这是我的第一次,但我会尝试
-
值得一试,相信我。
-
@yunzen 添加了一个jsfiddle
-
如您所见,小提琴不会重现问题,因此您的代码中肯定有其他问题。你有一个特殊的ie.css 文件吗?还尝试检查元素并将每个父元素的 css 复制到您的小提琴中
标签: html css internet-explorer hover css-sprites