谁能明白为什么这在IE6中不起作用。悬停图像根本不显示,如果我替换背景色,也不会显示。我已经尝试了绝对和相对路径。如果有人能指出我的错误,我将不胜感激。谢谢。
.CSS
.buttonMailTrue:hover {
width:290px;
height: 44px;
background: url('http://localhost/sample/users/images/mail_icon_strip_hover.png') no-repeat;
background-repeat: no-repeat;
}
.JS
<script type="text/javascript">
$(function() {
$('.buttonMailTrue').hover(function() {
$(this).addClass('hover');
}, function() {
$(this).removeClass('hover');
});
});
</script>
.HTML
<div class='msgTrue buttonMailTrue' data-message='%s' data-subject='%s' data-rowdate='%s' data-from='%s'>
<img src="images/sml_new_mail_icon.gif" class="mailIcon" alt="" />
$subject;
<div style="float:right;margin-right:22px;margin-top:-12px;font-size:9px;">
$rowdate
</div><br />
span style="font-weight:bold;margin-top:50px;">$from</span>
</div>
<br />
试试这个:
- 将".buttonMailTrue:hover"更改为".hover"
- 在 SPAN 标记的开头添加"<"。
- 从CSS中删除"background-repeat: no-repeat;",因为你要声明它两次。
- 将一些背景位置值添加到您的 CSS 中。