다음 예는 키프레임 구문을 사용하여 높이, 너비, 색상, 이름 및 애니메이션 지속 시간을 보여줍니다. −
예시
<html>
<head>
<style type = "text/css">
h1 {
-moz-animation-duration: 3s;
-webkit-animation-duration: 3s;
-moz-animation-name: slidein;
-webkit-animation-name: slidein;
}
@-moz-keyframes slidein {
from {
margin-left:100%; width:300%
}
to {
margin-left:0%; width:100%;
}
}
@-webkit-keyframes slidein {
from {
margin-left:100%; width:300%
}
to {
margin-left:0%; width:100%;
}
}
</style>
</head>
<body>
<h1>Tutorials Point</h1>
<p>this is an example of moving left animation .</p>
<button onclick = "myFunction()">Reload page</button>
<script> function myFunction() { location.reload(); } </script>
</body>
</html>