使用CSS的另一個問題。CSS顏色轉換不起作用:懸停
我希望頭部的背景顏色從懸停時(由於多個站點具有不同的顏色)當前轉換到另一個。
我做了一個CSS-transition-animation它,但它似乎並沒有工作。 我在做什麼錯?
#header
{
background-color: #3cff9c;
float: left;
text-align: center;
width: 100%;
}
#header:hover
{
/*Animation*/
-webkit-animation: colorChange_blue 1s; /* Safari, Chrome, Opera*/
-moz-animation: colorChange_blue 1s; /*Firefox*/
animation: colorChange_blue 1s; /*Standard*/
/*Safari, Chrome, Opera*/
@-webkit-keyframes colorChange_blue
{
from
{background-color;}
to
{background-color: #008c74;}
}
/*Firefox*/
@-moz-keyframes colorChange_blue
{
from
{background-color: currentColor;}
to
{background-color: #008c74;}
}
/*Standard*/
@keyframes colorChange_blue
{
from
{background-color: currentColor;}
to
{background-color: #008c74;}
}
}
沒有ü錯過閉架中的#header:懸停? – 2015-02-24 09:14:42
你使用'currentColor'或它的值#3cff9c在每個部分 – singhiskng 2015-02-24 09:16:25
@matteo看起來不像它。從我所知道的情況來看,它完全在底部。 – 2015-02-24 09:16:45