Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS CSS Transitions and Transforms Adding 3D Effects with CSS Build a Rotating 3D Cube

3d cube

/* ================================= Button Transitions ==================================== */

.button { transition: background .3s; } .button:hover { background: rgba(74,137,202, 1); }

/* ================================= Photo 3D Transforms & Transitions ==================================== */

.cube-container { box-shadow: 0 18px 40px 5px rgba(0,0,0,.4); perspective: 800px; }

.photo-cube { transition: transform 2s ease-in-out; width: 220px; height: 200px; transform-style: preserve-3d; }

.photo-cube:hover { transform: rotateY(-270deg); }

.front, .back, .left, .right { width: 100%; height: 100%; display: block; position: absolute; backface-visibility: hidden; transform-style: preserve-3d;

}

.front { transform: translate3d(0, 0, 110px); }

.back { transform: translateZ(-110px) rotateY(270deg); transform-origin: center left;

.left { transform: rotateY(-270deg) translate3d(110px, 0, 0); transform-origin: top right;

}

.right { transform: translateZ(-110px) rotateY(180deg);

}

can someone tell me where is my mistake , followed everything what Guill did even i added the backface-visibility: hidden; and transform-style: preserve 3d but i still cannot find a solution . thanks

Have you run the code through the W3C CSS validator?

Value Error : left Parse Error .left { transform: rotateY(-270deg) translate3d(110px, 0, 0); transform-origin: top right; } .right { transform: translateZ(-110px) rotateY(180deg); }

2 Answers

Thank you for replying Bert i ran it right now and it says that i have a parse error and when i looked up parse error it says that most likely is a typing mistake but i still cannot find it .

It says that the parse error is with the class .back on line 27 . .back { transform: translateZ(-110px) rotateY(270deg); transform-origin: center left;

Oh I see it, there's not a closing bracket for that rule, .back

Bert you are the Man . Thanks !

You're welcome! Glad it worked out