<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>标题</title>
<style>
* {
margin: 0;
padding: 0;
}
body {
perspective: 500px;
}
div {
width: 300px;
height: 300px;
margin: 200px auto;
transform-style: preserve-3d;
position: relative;
animation: rotate 10s linear 0s infinite normal;
}
ul li {
height: 300px;
width: 300px;
list-style: none;
position: absolute;
border: 1px solid skyblue;
box-sizing: border-box;
top: 0;
left: 0;
}
ul li:nth-child(1) {
background-color: red;
transform: rotateX(90deg) translateZ(150px) scale(1.5, 1);
}
ul li:nth-child(2) {
background-color: blue;
transform: rotateX(180deg) translateZ(150px) scale(1.5, 1);
}
ul li:nth-child(3) {
background-color: yellow;
transform: rotateX(270deg) translateZ(150px) scale(1.5, 1);
}
ul li:nth-child(4) {
background-color: orange;
transform: rotateX(360deg) translateZ(150px) scale(1.5, 1);
}
ul li img {
height: 300px;
width: 300px;
}
@keyframes rotate {
from {
transform: rotateX(0deg);
}
to {
transform: rotateX(360deg);
}
}
</style>
</head>
<body>
<div>
<ul>
<li><img src="timg.jpeg" alt=""></li>
<li><img src="timg-2.jpeg" alt=""></li>
<li><img src="timg-3.jpeg" alt=""></li>
<li><img src="timg-4.jpeg" alt=""></li>
</ul>
</div>
</body>
</html>