动画演示后,如果想要保持动画后的样式,该怎么实现
来源:2-14 编程练习
lala啦啦
2018-03-07 20:15:52
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>2-4</title>
<style type="text/css">
div {
font-family: 'Microsoft Yahei';
font-size: 60px;
font-weight: bold;
line-height: 600px;
position: absolute;
top: -1000px;
right: 0;
left: 0;
width: 800px;
height: 600px;
margin: auto;
text-align: center;
border: 5px solid #000;
border-radius: 50%;
animation-name: disp;
animation-duration: 1s;
/*此处写代码*/
animation-delay:2s;
}
@keyframes disp {
from {top:-1000px;}
to {top:0px;}
}
</style>
</head>
<body>
<div>大家好,欢迎来到慕课网!</div>
</body>
</html>1回答
CSS3 里面 animation下有个animation-fill-mode 设定动画完成后的状态,默认是none 设为forwards 就可以在动画完成后定格在动画最后一帧
相似问题