我正在创建一个小型企业页面。我有一个为我的导航按钮创建的背景图片。我希望它们在悬停在图像上时具有过渡效果。它适用于Chrome,但我无法弄清楚为什么我的代码无法在Firefox或Internet Explorer中运行。在CSS3中不能在Firefox或Internet Explorer中工作
.nav li a.active {
background-image: url('../images/02amainhover.png');
background-color: transparent;
background-repeat: no-repeat;
background-attachment: center center;
width: 245px;
height: 74px;
left: 72px;
top: 432px;
position: fixed;
transition: all .8s ease-out;
-moz-transition: all .8s ease-out;
}
.nav li a.active:hover {
background-image: url('../images/03amainhover.png');
background-color: transparent;
background-repeat: no-repeat;
background-attachment: center center;
width: 245px;
height: 74px;
left: 72px;
top: 432px;
position: fixed;
transition: all .8s ease-in;
-moz-transition: all .8s ease-in;
}
这让人有点更多,因为,我想这将解释为什么它不能正常工作!谢谢,我可以看到参考表对我非常有用。至于重复的代码部分,我认为这是很好的补充?之前有人曾经提到,有时浏览器需要重复代码才能获得更多规范,并且缺少重复代码有时可能会导致代码无法正常工作的问题? – Mars
旧版浏览器(IE6)需要为':hover'重复执行任何更改后的值。基本上它需要知道如何改变':hover'以及如何改变。 – KnightHawk
如果人们还在为IE6编码,他们会做错事。 –