麻烦老师检查下代码,谢谢
来源:2-20 编程练习
叫我丽红
2021-04-26 10:19:51
<!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:fr 1s ease 2s infinite;
/*此处写代码*/
}
@keyframes fr{
from{
top: -1000px;
}
to{
top:0;
}
}
</style>
</head>
<body>
<div>大家好,欢迎来到慕课网!</div>
</body>
</html>
1回答
好帮手慕久久
2021-04-26
同学你好,代码是对的,很棒!
优化建议:
建议让元素动画只执行一次,并保持最终的效果,这样更好看些:
祝学习愉快!
相似问题