麻烦老师查看作业
来源:2-18 编程练习
派大星爱学习
2022-05-01 09:58:14
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
div {
width: 200px;
height: 200px;
font-size: 200px;
transform: rotate(90deg);
position: absolute;
left: 50%;
bottom: 0;
animation: r 2s linear 0s infinite;
}
@keyframes r {
50% {
bottom: 100px;
}
70% {
bottom: 70px;
}
100% {
bottom: 100px;
}
}
</style>
</head>
<body>
<div>></div>
</body>
</html>
2回答
好帮手慕星星
2022-05-03
同学你好,样式中设置默认bottom值为0,动画中初始bottom值为100px
所以是开始是从下往上运动,看着是反的。建议将初始位置变为100px,并且设置样式居中
祝学习愉快!
派大星爱学习
提问者
2022-05-01
老师 这个方向为什么是反的?
相似问题