2016-11-11 1 views
0

이것은 바보 같은 질문 일지 모르지만 내 코드에서 태그를 보라색에서 빨간색으로 그라디언트로 바꾸고 태그 또는 다른 태그 위로 마우스를 가져 가지 않고 그 자체로 돌아가는 방법을 알고 싶습니다.CSS에서 텍스트의 색상을 변경하는 방법은 무엇입니까?

저는 약간의 연구를 해왔고 웹킷과 웹킷 애니메이션이라는 용어를 계속 사용하고 있습니다.

나는 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> 
관련 문제