코드:
결과보기 »
<!DOCTYPE html> <html lang="ko"> <head> <meta charset="UTF-8"> <title>CSS3 Animation</title> <style> p { height: 40px; width: 400px; border: solid 5px red; -webkit-animation-name: movingPara; -webkit-animation-duration: 4s; animation-name: movingPara; animation-duration: 4s; } @-webkit-keyframes movingPara { 0% { border-color: red; } 20% { border-color: orange; } 40% { border-color: yellow; } 50% { border-color: green; } 60% { border-color: blue; } 80% { border-color: navy; } 100% { border-color: purple; } } @keyframes movingPara { 0% { border-color: red; } 20% { border-color: orange; } 40% { border-color: yellow; } 50% { border-color: green; } 60% { border-color: blue; } 80% { border-color: navy; } 100% { border-color: purple; } } </style> </head> <body> <h1>@keyframes 규칙을 이용한 애니메이션 효과</h1> <p>다양한 애니메이션 효과를 간단하게 줄 수 있어요!</p> </body> </html>