Simple 3d translucent cube Image Display with css3, css33d translucent cube
<Html>
<Head>
<Title> new document </title>
<Meta name = "generator" content = "editplus"/>
<Meta name = "author" content = ""/>
<Meta name = "keywords" content = ""/>
<Meta name = "description" content = ""/>
<Meta charset = "UTF-8"/>
<Style type = "text/css">
// Css part
Html {
Font-size: 62.5%;
}
Img {
Width: 300px;
Height: 300px;
}
# Stage {
// Set up a stage
Margin-top: 200px;
Margin-left: auto;
Margin-right: auto;
Width: 300px;
Height: 300px;
Perspective: pixel PX;
Font-size: 5em;
Font-weight: bold;
Color: # cc00ff;
}
. Cube {
// Cube is a cube
Position: relative;
Transform: rotateX (-45deg) rotateY (45deg );
Transform-style: preserve-3d;
Transition: all. 6 s;
}
. Side {
Color: blue;
Text-align: center;
Width: 300px;
Height: 300px;
Line-height: 300px;
Position: absolute;
Background: # cc66ff;
Opacity: 0.5;
Border: 1px solid rgba (117,4, 24, 0.5 );
}
//. Front to. bottom is rotated on six sides respectively to construct cube shaping.
. Front {
Transform: translateZ (150px );
}
. Back {
Transform: rotateY (180deg) translateZ (150px );
}
. Left {
Transform: rotateY (-90deg) translateZ (150px );
}
. Right {
Transform: rotateY (90deg) translateZ (150px );
}
. Top {
Transform: rotateX (90deg) translateZ (150px );
}
. Bottom {
Transform: rotatex (-90deg) translateZ (150px );
}
# Stage: hover. cube {
// Set whether the transition effect and the start and end time and speed of the transition effect are required when the cursor moves to the cube.
Transform: rotateX (-45deg) rotateY (225deg );
Transition: transform. 6 s;
}
</Style>
</Head>
//Div
<Body>
<Div id = "stage">
<Div class = "cube">
<Div class = "side front"> </div>
<Div class = "side back"> </div>
<Div class = "side left"> </div>
<Div class = "side right"> </div>
<Div class = "side top"> </div>
<Div class = "side bottom"> </div>
</Div>
</Div>
</Body>
</Html>