[Asm] 纯文本查看 复制代码
<!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>
</head>
<body> <style>
* {
padding: 0;
margin: 0;
box-sizing: border-box;
background-color: #2C3E51;
}
body,div{
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
div {
justify-content: center;
align-items: center;
width: 400px;
height: 400px;
border: 2px solid white;
}
span {
position: relative;
left: 0;
width: 50px;
height: 50px;
background-color: rgb(255, 183, 0);
display: inline-block;
animation-name: fd;
animation-duration: 8s;
animation-timing-function: cubic-bezier(1, 0, 0, 1);
}
@keyframes fd {
25% {transform: translate(-395%,-350%);}
50% {transform: translate(-395%,350%);}
75% {transform: translate(300%,350%);}
100% {transform: translate(300%,-350%);}
to {}
}
</style>
<main>
<div>
<p>测试数</p>
<span>
</span>
</div>
</main>
</body>
</html>
动画代码如上
有几点疑惑
css属性太多 容易忘记 是不是有必要记住那些属性?
代码大部分都看得懂 但还是很难完成项目 这是为什么?
|