2016-11-11 1 views
0

これはちょっと疑問に思うかもしれませんが、コード内のタグを紫色から赤色のグラデーションに変え、それを元に戻す方法を知りたいと思います。CSSでテキストの色を変える方法は?

私はいくつかの研究をしようとしてきました。私はwebkitとwebkit animationというものを紹介し続けます。

私は非常に初心者がhtml、css、jsを持っているので、これを使用する方法がわかりません。誰かが私が探している色の間の移行を達成する方法の例を私に提供することはできますか?

+1

http://www.w3schools.com/css/css3_animations.asp –

答えて

0
<!DOCTYPE html> 
<html> 
<head> 
<style> 
div { 
    width: 100px; 
    height: 100px; 
    background-color: red; 
    -webkit-animation-name: example; /* Safari 4.0 - 8.0 */ 
    -webkit-animation-duration: 4s; /* Safari 4.0 - 8.0 */ 
    animation-name: example; 
    animation-duration: 4s; 
} 

/* Safari 4.0 - 8.0 */ 
@-webkit-keyframes example { 
    from {background-color: red;} 
    to {background-color: yellow;} 
} 

/* Standard syntax */ 
@keyframes example { 
    from {background-color: red;} 
    to {background-color: yellow;} 
} 
</style> 
</head> 
<body> 

<p><b>Note:</b> This example does not work in Internet Explorer 9 and earlier versions.</p> 

<div></div> 

<p><b>Note:</b> When an animation is finished, it changes back to its original style.</p> 

</body> 
</html> 
関連する問題