【发布时间】:2012-07-16 06:10:22
【问题描述】:
我正在使用基于 CSS 的翻转“技巧”,它在悬停时切换元素背景图像的背景位置。
CSS
#welcome #step1
{background: transparent url(../img/mock/homepage_welcome_step1.png) no-repeat scroll left top;}
#welcome #step1:hover
{background: transparent url(../img/mock/homepage_welcome_step1.png) no-repeat scroll right top;}
HTML
<div id="welcome">
<a class="steps" id="step1" href="?page=signup"></a>
...
</div>
IE6 自然地把这个简单的事情搞砸了。我所有的翻转都闪烁。
鼠标悬停时图像消失片刻,然后移动到上方状态。一个有趣的怪癖,如果我离开页面然后按 BACK 按钮,问题似乎就消失了!
我认为这与 PNG 图像文件有关(尽管它们没有任何透明度)或者可能是简单的文档类型(XHTML 过渡)
感谢您的洞察力。
编辑(已解决):
Jitendra 提供了解决问题的链接。我只是将它添加到头部:
<!--[if IE 6]>
<style type="text/css" >
html {
filter: expression(document.execCommand("BackgroundImageCache", false, true));
}
</style>
<![endif]-->
【问题讨论】:
标签: html css internet-explorer-6