使用CSS推出动画效果
要使用CSS创建首次展示动画效果,您可以尝试运行以下代码-
示例
<html>
<head>
<style>
.animated {
background-image: url(/css/images/logo.png);
background-repeat: no-repeat;
background-position: left top;
padding-top:95px;
margin-bottom:60px;
-webkit-animation-duration: 10s;
animation-duration: 10s;
-webkit-animation-fill-mode: both;
animation-fill-mode: both;
}
@-webkit-keyframes rollOut {
0% {
opacity: 1;
-webkit-transform: translateX(0px) rotate(0deg);
}
100% {
opacity: 0;
-webkit-transform: translateX(100%) rotate(120deg);
}
}
@keyframes rollOut {
0% {
opacity: 1;
transform: translateX(0px) rotate(0deg);
}
100% {
opacity: 0;
transform: translateX(100%) rotate(120deg);
}
}
.rollOut {
-webkit-animation-name: rollOut;
animation-name: rollOut;
}
<style>
</head>
<body>
<div id = "animated-example" class = "animated rollOut"></div>
<button onclick = "myFunction()">Reload page</button>
<script>
function myFunction() {
location.reload();
}
</script>
</body>
</html>热门推荐
10 直播祝福语老师文案简短
11 对离岗同事祝福语简短
12 描写周末的祝福语简短
13 登上舞台祝福语大全简短
14 祝寿时祝福语简短精辟
15 下雪宝宝生日祝福语简短
16 导师退休花束祝福语简短
17 结婚对白誓言简短祝福语
18 永远漂亮祝福语女生简短