我正在創建一個小型企業頁面。我有一個爲我的導航按鈕創建的背景圖片。我希望它們在懸停在圖像上時具有過渡效果。它適用於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編碼,他們會做錯事。 –