本帖最后由 德古拉伯 于 2020-1-29 13:05 编辑
转的动啊,我没用图片,是用的背景色
你把persective调到700px明显一点
[HTML] 纯文本查看 复制代码 <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
body {
perspective: 400px;
}
.box {
position: relative;
width: 300px;
height: 200px;
margin: 200px auto;
transform-style: preserve-3d;
}
div[class^="dog"] {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: pink;
background: url(media/dog.jpg);
}
div.dog1 {
transform: rotateY(0) translateZ(200px);
background-color: pink;
}
div.dog2 {
transform: rotateY(60deg) translateZ(200px);
background-color: skyblue;
width: 400px;
}
</style>
</head>
<body>
<div class="box">
<div class="dog1"></div>
<div class="dog2"></div>
<div class="dog3"></div>
<div class="dog4"></div>
<div class="dog5"></div>
<div class="dog6"></div>
</div>
</body>
</html> |