<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>长方体特效</title>
<style type="text/css">
ul{
width: 600px;
height: 560px;
list-style: none;
position: relative;
margin: 0 auto;
transform: rotateX(0deg)rotateY(30deg);
transform-style: preserve-3d;
animation: zz 10s infinite;
}
@keyframes zz{
0%{transform: rotateX(0deg) rotateY(0deg);}
25%{transform: rotateX(0deg) rotateY(360deg);}
50%{transform: rotateX(0deg) rotateY(0deg);}
100%{transform: rotateX(360deg) rotateY(0deg);}
}
.front>img{
width: 100%;
height: 100%;
}
.behind>img{
width: 100%;
height: 100%;
}
.left>img{
width: 100%;
height: 100%;
}
.right>img{
width: 100%;
height: 100%;
}
.top>img{
width: 100%;
height: 100%;
}
.bottom>img{
width: 100%;
height: 100%;
}
.left{
width: 200px;
height: 200px;
transform: rotateY(-90deg) translateZ(100px);
background-color: red;
position: absolute;
left: 100px;
top: 150px;
}
.right{
width: 200px;
height: 200px;
transform: rotateY(90deg) translateZ(100px);
background-color: blue;
position: absolute;
right: 140px;
top: 150px;
}
.front{
width: 400px;
height: 200px;
transform: translateZ(100px);
background-color: sandybrown;
position: absolute;
left: 100px;
top: 150px;
}
.behind{
width: 400px;
height: 200px;
transform: translateZ(-100px);
background-color: brown;
position: absolute;
left: 100px;
top: 150px;
}
.top{
width: 400px;
height: 200px;
background-color: green;
transform: rotateX(90deg);
position: absolute;
top: 50px;
left: 100px;
}
.bottom{
width: 400px;
height: 200px;
background-color: cornflowerblue;
transform: rotateX(90deg);
position: absolute;
left: 100px;
top: 250px;
}
</style>
</head>
<body>
<ul>
<li class="front"><img src="img/qian.jpg" ></li>
<li class="behind"><img src="img/1.jpg" ></li>
<li class="top"><img src="img/shang.jpg" ></li>
<li class="bottom"><img src="img/xia.jpg" ></li>
<li class="left"><img src="img/you.jpg" ></li>
<li class="right"><img src="img/zuo.jpg" ></li>
</ul>
</body>
</html>
html+css立方体特效
最新推荐文章于 2024-01-04 22:28:58 发布