旋转的轮播图
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<style>
body {
perspective: 1000px;
}
section {
width: 300px;
height: 200px;
margin: 100px auto;
background: url(../images/img-1.jpg) no-repeat;
background-size: cover;
position: relative;
transform-style: preserve-3d; /* 让父盒子里面的子盒子以3d效果显示 */
transition: 5s linear; /* 匀速 all 是可以省略的, 省略默认的all*/
}
section:hover {
transform: rotateY(360deg);
}
section div {
width: 100%;
height: 100%;
background: url(../images/dog.gif) no-repeat;
background-size: cover;
position: absolute;
top: 0;
left: 0;
}
section div:nth-child(1) {
transform: rotateY(0deg) translateZ(400px);
}
section div:nth-child(2) {
transform: rotateY(60deg) translateZ(400px);
}
section div:nth-child(3) {
transform: rotateY(120deg) translateZ(400px);
}
section div:nth-child(4) {
transform: rotateY(180deg) translateZ(400px);
}
section div:nth-child(5) {
transform: rotateY(240deg) translateZ(400px);
}
section div:nth-child(6) {
transform: rotateY(300deg) translateZ(400px);
}
</style>
</head>
<body>
<section>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</section>
</body>
</html>