标签:
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<style>
.cube {
position: absolute;
top: 200px;
left: 200px;
width: 200px;
height: 200px;
-webkit-perspective: 450px;
-webkit-transform-style: preserve-3d;
-webkit-perspective-origin: -100% -50%;
}
.cube>div {
display: block;
position: absolute;
width: 100px;
height: 100px;
line-height: 100px;
font-size: 60px;
color: white;
text-align: center;
}
.id0 {
border: 1px dashed black;
background: transparent;
}
.id1 {
border: none;
background: rgba(0,0,0,0.3);
-webkit-transform: translateZ(50px);
}
.id2 {
background: rgba(0,255,0,1);
-webkit-transform: translateZ(-50px);
}
.id3 {
background: rgba(196,0,0,0.7);
-webkit-transform: rotateY(90deg) translateZ(-50px);
}
.id4 {
background: rgba(0,0,196,0.7);
-webkit-transform: rotateY(-90deg) translateZ(-50px);
}
.id5 {
background: rgba(196,196,0,0.7);
-webkit-transform: rotateY(90deg) translateZ(-50px);
}
.id6 {
background: rgba(196,0,196,0.7);
-webkit-transform: rotateY(-90deg) translateZ(-50px);
}
</style>
<body>
<div class="cube">
<div class="id0"></div>
<div class="id1">1</div>
<div class="id2">2</div>
<div class="id3">3</div>
<div class="id4">4</div>
<div class="id5">5</div>
<div class="id6">6</div>
</div>
</body>
</html>
标签:
原文地址:http://www.cnblogs.com/chengwangjun/p/5031256.html