源代码如下
这里主要是使用css动画属性和3d旋转
代码语言:javascript复制<!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>
<style>
ul,li{
padding: 0;
margin: 0;
list-style: none;
}
body{
perspective:1000px;
}
ul{
position: relative;
width: 200px;
height:300px;
margin:150px auto;
transform-style: preserve-3d;
animation: move 10s linear infinite;
}
li{
position: absolute;
top: 0;
left: 0;
width:200px;
height:300px;
}
@keyframes move{
0%{
transform: rotateY(0);
}
100%{
transform: rotateY(360deg);
}
}
ul li:nth-child(1){
transform:rotateY(0) translateZ(300px);
}
ul li:nth-child(2){
transform:rotateY(60deg) translateZ(300px);
}
ul li:nth-child(3){
transform:rotateY(120deg) translateZ(300px);
}
ul li:nth-child(4){
transform:rotateY(180deg) translateZ(300px);
}
ul li:nth-child(5){
transform:rotateY(240deg) translateZ(300px);
}
ul li:nth-child(6){
transform:rotateY(300deg) translateZ(300px);
}
li img{
width:200px;
height:300px;
}
</style>
</head>
<body>
<ul>
<li>
<img src="../h5css3/image/780.jfif" alt="">
</li>
<li>
<img src="../h5css3/image/780.jfif" alt="">
</li>
<li>
<img src="../h5css3/image/780.jfif" alt="">
</li>
<li>
<img src="../h5css3/image/780.jfif" alt="">
</li>
<li>
<img src="../h5css3/image/780.jfif" alt="">
</li>
<li>
<img src="../h5css3/image/780.jfif" alt="">
</li>
</ul>
<div>
</div>
</body>
</html>