麻烦老师检查
来源:2-20 编程练习
dww1
2021-10-21 00:26:42
<style>
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:disp 1s linear 2s infinite;
}
@keyframes disp{
0%{
/* top:-1000px; */
transform: translateY(-1000px);
}
50%{
/* top:0; */
transform: translateY(1000px);
}
100%{
/* top:0; */
transform: translateY(1000px);
}
}
</style>
一种是from -to 一种是关键帧<div>大家好,欢迎来到慕课网!</div>
1回答
好帮手慕星星
2021-10-21
同学你好,可以不设置重复动画

其他动画没问题。继续加油,祝学习愉快!
相似问题