3d旋转相册
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>
div {
width: 300px;
height: 300px;
position: fixed;
left: 0;
top: 0;
right: 0;
bottom: 0;
margin: auto;
transform: rotatex(10deg) rotatey(15deg);
transform-style: preserve-3d;
animation: play 40s infinite linear;
}
div img {
width: 300px;
height: 300px;
position: absolute;
border:1px solid #fff;/*出现s型转动的问题,给img加边框,或者把图片换成背景图片*/
}
img:nth-child(1) {
transform: rotatey(0deg) translatez(300px);
}
img:nth-child(2) {
transform: rotatey(60deg) translatez(300px);
}
/*如果不是6张图片,需要改旋转度数,度数是用360除以图片的个数,translatez可以随意改*/
img:nth-child(3) {
transform: rotatey(120deg) translatez(300px);
}
img:nth-child(4) {
transform: rotatey(180deg) translatez(300px);