卡片旋转案例
<body>
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
</ul>
</body>
<style>
*{
margin: 0;
padding: 0;
}
body{
perspective: 600px;
}
ul{
list-style: none;
width: 400px;
height: 500px;
margin: 50px auto;
position: relative;
transform: rotateX(-45deg);
transform-style:preserve-3d;
}
ul>li{
width: 100px;
height: 200px;
line-height: 200px;
color: #ffffff;
background-color: hotpink;
text-align: center;
font-size: 30px;
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
margin: auto;
}
ul>li:nth-child(1){
transform: rotateY(0deg) translateZ(200px);
}
ul>li:nth-child(2){
transform: rotateY(60deg) translateZ(200px);
}
ul>li:nth-child(3){
transform: rotateY(120deg) translateZ(200px);
}
ul>li:nth-child(4){
transform: rotateY(180deg) translateZ(200px);
}
ul>li:nth-child(5){
transform: rotateY(240deg) translateZ(200px);
}
ul>li:nth-child(6){
transform: rotateY(300deg) translateZ(200px);
}
</style>

