console
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>css3原生3D</title>
<link rel="stylesheet" href="css/app.css">
</head>
<body>
<div class="heart3d">
<div><img src="img/1.png" alt="" width="300" height="300"></div>
<div><img src="img/1.png" alt="" width="300" height="300"></div>
<div><img src="img/1.png" alt="" width="300" height="300"></div>
<div><img src="img/1.png" alt="" width="300" height="300"></div>
<div><img src="img/1.png" alt="" width="300" height="300"></div>
<div><img src="img/1.png" alt="" width="300" height="300"></div>
</div>
</body>
</html>
body{
perspective: 1000px;
}
.heart3d{
position: relative;
width: 300px;
height: 300px;
margin: 250px auto;
transform-style: preserve-3d;
transition: 10s;
transform-origin: 50% 50% -101px;
}
.heart3d div{
position: absolute;
top: 0;
left: 0;
width: 300px;
height: 300px;
border: 2px solid red;
}
.heart3d div:nth-child(1){
top: -302px;
left: 0;
transform-origin: bottom;
transform: rotateX(90deg);
}
.heart3d div:nth-child(2){
top: 302px;
left: 0;
transform-origin: top;
transform: rotateX(-90deg);
}
.heart3d div:nth-child(3){
top: 0;
left: -302px;
transform-origin: right;
transform: rotateY(-90deg);
}
.heart3d div:nth-child(4){
top: 0;
left: 302px;
transform-origin: left;
transform: rotateY(90deg);
}
.heart3d div:nth-child(5){
}
.heart3d div:nth-child(6){
transform: translateZ(-302px);
}
.heart3d:hover{
transform: rotateY(360deg);
}