keyframes动画效果
程序员文章站
2022-03-16 19:01:16
...
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
.box{
width:300px;
height: 200px;
border: 1px solid red;
/* 表示永远的旋转 */
animation: myAnimal 5s infinite;
}
/* 定义一个动画 */
@keyframes myAnimal{
from{
background-color: #228B22;
width:300px;
height: 200px;
border-radius: 1px;
}
to{
background-color: #228B22;
width:500px;
height: 400px;
border-radius: 50%;
}
}
</style>
</head>
<body>
<div class="box"></div>
</body>
</html>