<! DOCTYPE html>
<meta charset= "UTF-8" >
<TITLE>CSS3 (3D Dice) </title>
<style>
*{padding:0px;margin:0px;}
#container {
width:500px;
height:500px;
border:1px solid red;
perspective:800px;
margin:0 Auto;
}
#wrap {
width:100px;
height:100px;
position:relative;
top:50%;
left:50%;
margin-top:-50px;
margin-left:-50px;
transform-style:preserve-3d;
}
li{
List-style:none;
width:100px;
height:100px;
Position:absolute;
Text-align:center;
line-height:100px;
Color:white;
font-size:36px;
}
Li:nth-of-type (1) {
Background:green;
top:-100px;
left:0px;
Transform:rotatex ( -90DEG);
Transform-origin:bottom;
}
Li:nth-of-type (2) {
Background:blue;
top:0px;
Left: -100px;
Transform:rotatey (90DEG);
Transform-origin:right;
}
Li:nth-of-type (3) {
Background:gray;
top:0px;
left:0px;
Transform:translatez (0px);
}
Li:nth-of-type (4) {
Background:orange;
top:0px;
left:100px;
Transform:rotatey ( -90DEG);
Transform-origin:left;
}
Li:nth-of-type (5) {
Background:black;
top:100px;
left:0px;
Transform:rotatex (90DEG);
Transform-origin:top;
}
Li:nth-of-type (6) {
Background: #3194EF;
top:0px;
left:0px;
Transform:translatez (100px);
}
#container: hover #wrap {
Transform:rotatex (600deg) Rotatey (600deg);
-webkit-transform:rotatex (600deg) Rotatey (600deg);
Transition:transform 5s;
}
</style>
<body>
<div id= "Container" ><!--stage---
<div id= "wrap" ><!--container--
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
</ul>
</div>
</div>
</body>
CSS3 (3D Dice)