使用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 五二零朋友祝福语大全简短