這是一個非常簡單的問題,但我無法在CSS轉換屬性中找到非常好的文檔。這裏是CSS代碼片段:如何在一個元素上進行多個CSS轉換?
.nav a
{
text-transform:uppercase;
text-decoration:none;
color:#d3d3d3;
line-height:1.5 em;
font-size:.8em;
display:block;
text-align:center;
text-shadow: 0 -1.5em 0 rgba(255, 255, 255, 0.15);
-webkit-transition: color .2s linear;
-moz-transition: color .2s linear;
-o-transition: color .2s linear;
transition: color .2s linear;
-webkit-transition: text-shadow .2s linear;
-moz-transition: text-shadow .2s linear;
-o-transition: text-shadow .2s linear;
transition: text-shadow .2s linear;
}
.nav a:hover
{
color:#F7931E;
text-shadow: 0 1.5em 0 rgba(247, 147, 30, 0.15);
}
正如你所看到的,過渡屬性是相互覆蓋的。就目前而言,文字陰影會產生動畫效果,但不是顏色。我如何讓它們同時動畫?感謝任何答案。
爲什麼這個逗號分開但變換不是!來吧標準...... –
我假設因爲變換是一個順序很重要的鏈,所以如果你習慣了功能鏈,那麼語法就會很好,而過渡需要一個完全獨立元素的無序列表,所以逗號是合適的 – mirichan