使用 CSS3 实现左侧动画的关键帧示例
cssweb developmentfront end technology更新于 2024/3/20 18:20:17
以下示例使用关键帧语法展示了动画的高度、宽度、颜色、名称和时长 −
示例
<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>
相关文章
有用资源
css 参考教程 - 该教程包含有关 css 的更多信息:https://www.cainiaomax.com/css/

