我最近實現了一些CSS代碼,以使我的徽標以灰度顏色開始,當用戶將鼠標移到它上面時,徽標變爲彩色。它在Chrome中運行良好,但是在FireFox中,只有將鼠標懸停在徽標上時,該徽標纔可見。有誰知道如何解決這個問題?灰度鼠標移至徽標的顏色效果在FireFox中不起作用
CSS:
#logos img {
filter: url('js/filters.svg#grayscale'); /* Firefox 3.5+ */
filter: gray; /* IE6-9 */
-webkit-filter: grayscale(1); /* Webkit Nightlies & Google Chrome Canary */
opacity: .5;
padding: 20px;
}
#logos img:hover {
filter: none; /* Applies to FF + IE */
-webkit-filter: grayscale(0);
opacity: 1;
-webkit-transition: 0.3s all ease-in;
-o-transition: 0.3s all ease-in;
-moz-transition: 0.3s all ease-in;
transition: 0.3s all ease-in;
}
HTML:
<section style="z-index:1; background-color:#f5f5f5;">
<section class="container">
<center>
<div id="logos" class="col-md-12">
<a href="#" target="_blank"><img src="images/dell_logo.png" alt="" title=""/></a>
<!--<a href="#" target="_blank"><img src="images/centos_logo.png" alt="" title=""/></a>-->
<a href="#" target="_blank"><img src="images/endian_logo.png" alt="" title=""/></a>
<a href="#" target="_blank"><img src="images/ccsp_logo.png" alt="" title=""/></a>
<a href="#" target="_blank"><img src="images/bbb_logo.png" alt="" title=""/></a>
<a href="#" target="_blank"><img src="images/microsoft_logo.png" alt="" title=""/></a>
</div>
</center>
</section>
完美。我只是忘了添加-moz-聲明。多謝你們! – redshift