<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style type="text/css">
*{
margin: 0;
padding: 0;
}
section{
width: 400px;
height: 400px;
background: url(img/1.jpg) no-repeat;
background-size: 100% 100%;
position: fixed;
margin: auto;
left: 0;right: 0;
top: 0;bottom: 0;
transform-style: preserve-3d;
transform: rotateX(20deg) rotateY(30deg);
}
div{
width: 400px;
height: 400px;
text-align: center;
line-height: 400px;
font-size: 100px;
color: #fff;
font-weight: 900;
position: absolute;
/* 透明 */
opacity: 0.6;
}
div:nth-child(1){
background: red;
transform: translateZ(200px);
}
div:nth-child(2){
background: blue;
transform: translateZ(-200px) rotateY(180deg);
}
div:nth-child(3){
background: pink;
transform: translateY(-200px) rotateX(90deg);
}
div:nth-child(4){
background: orange;
transform: translateY(200px) rotateX(-90deg);
}
div:nth-child(5){
background: yellow;
transform: translateX(-200px) rotateY(-90deg);
}
div:nth-child(6){
background: purple;
transform: translateX(200px) rotateY(90deg);
}
section:hover{
transform: rotateX(20deg) rotateY(30deg) scaleZ(2);
}
</style>
</head>
<body>
<section>
<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>
<div>5</div>
<div>6</div>
</section>
</body>
</html>