代码:
<!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>同心圆的动态效果</title>
<style>
div{
box-sizing: border-box;
}
.room{
width: 400px;
height: 400px;
background-color: black;
margin:0 auto;
padding: 50px;
animation: smaller 2000ms linear infinite alternate;
}
@keyframes smaller{
from{
padding: 50px;
}
to{
padding: 40px;
}
}
.circle1{
height: 100%;
border: 3px solid #666;
border-radius: 50%;