Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
In this video, you will build a rotating 3D photo cube using CSS transitions and 3D transforms.
Important Update
Browser rendering for 3D transforms changed since we recorded this video. If your rotating 3D cube does not look and work as it does in the video, add the following properties to the CSS rule selecting each side in interactions.css
:
.front,
.back,
.left,
.right {
width: 100%;
height: 100%;
display: block;
position: absolute;
/* New CSS */
transform-style: inherit;
backface-visibility: hidden;
}
Resources
- Using CSS 3D transforms
- perspective – MDN
- transform-style – MDN
- translateZ()
- Completing the Cube
Video review
- The
translateZ()
function lets you move an element along its Z-axis; that is, towards and away from the viewer. - A negative
translateZ()
moves the element away from the viewer on the Z-axis, while a positive value moves the element towards the viewer.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up