*{
margin: 0;
padding: 0;
}
body{
width: 100%;
height: 100vh;
background-color: black;
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
perspective: 900px;
}
section{
position: relative;
width: 300px;
height: 200px;
transform-style: preserve-3d;
animation: animation 20s linear infinite;
}
img{
width: 200px;
height:150px ;
margin-top: 30px;
}
section div{
position: absolute;
width: 100%;
height: 100%;
left: 0;
top:0;
line-height: 200px;
text-align: center;
-webkit-box-reflect: below 15px -webkit-linear-gradient(transparent 10%, rgba(255, 255, 255, 0.3));
}
section div:nth-child(1){
background-color: rgb(249, 217, 167);
transform:translateZ(300px) ;
}
section div:nth-child(2){
background-color: rgb(251, 185, 80);
transform: rotateY(60deg) translateZ(300px) ;
}
section div:nth-child(3){
background-color: rgb(134, 83, 1);
transform: rotateY(120deg) translateZ(300px) ;
}
section div:nth-child(4){
background-color: rgb(255, 158, 2);
transform: rotateY(180deg) translateZ(300px) ;
}
section div:nth-child(5){
background-color: rgb(156, 110, 37);
transform: rotateY(240deg) translateZ(300px) ;
}
section div:nth-child(6){
background-color: rgb(63, 39, 1);
transform: rotateY(300deg) translateZ(300px) ;
}
@keyframes animation {
0%{
transform: rotateY(0);
}
100%{
transform: rotateY(360deg);
}
}
<!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>
<link rel="stylesheet" href="./css/index.css">
</head>
<body>
<section>
<div><img src="./img/1.png" alt=""></div>
<div><img src="./img/2.png" alt=""></div>
<div><img src="./img/3.png" alt=""></div>
<div><img src="./img/4.png" alt=""></div>
<div><img src="./img/5.png" alt=""></div>
<div><img src="./img/6.png" alt=""></div>
</section>
</body>
</html>
望舒/css-age (gitee.com)https://gitee.com/wang-dd123/css-age
代码地址