使用 CSS3 实现 key 帧动画的示例
以下示例展示了使用 keyframe 语法的动画高度、宽度、颜色、名称和持续时间 -
范例
<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>
广告
数据结构
网络
关系数据库管理系统
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP