麻烦老师查看作业

来源: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>&gt;</div>

</body>

</html>


写回答

2回答

好帮手慕星星

2022-05-03

同学你好,样式中设置默认bottom值为0,动画中初始bottom值为100px

https://img.mukewang.com/climg/62709072099576f708230478.jpg

所以是开始是从下往上运动,看着是反的。建议将初始位置变为100px,并且设置样式居中

https://img.mukewang.com/climg/6270913c0936009c09400665.jpg

祝学习愉快!

0

派大星爱学习

提问者

2022-05-01

老师 这个方向为什么是反的?

0

0 学习 · 17877 问题

查看课程