3D旋转-旋转木马特效
首先给大家展示一下效果和代码。
在这里插入代码片
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
*{
margin:0;
padding:0;
}
body,html{
height:100%;
}
ul,li{
list-style:none;
}
body{
background:url(./images/yly1.jpg) no-repeat;
background-size:100% 100%;
perspective:2000px;
}
.box{
width:350px;
height:350px;
background:url(./images/a.gif) no-repeat center;
position: fixed;
left:0;top:0;
right:0;bottom:0;
margin:auto;
transform-style: preserve-3d;
animation: imgRotate 20S linear infinite;
}
.box .imgBox{
width:280px;
height:400px;
position:absolute;
transform-origin:center center -600px;
}
.box img{
display:block;
width:100%;
height:100%;
}
.imgBox1{
transform:translateZ(600px);