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

If the cube is spinning from left to right or vice versa, why are using the rotateY property?

I don't understand why we're using the rotateY property to spin a cube in a horizontal fashion. My intuition makes me think it would make the cube spin up or down.

1 Answer

The rotation happens around the axis. It felt counter-intuitive to me at first too because the cube is rotating through the horizontal x-axis. When I thought about having three axes though, the only way you can do it is if you describe the rotation in relation to the axis it is rotating around rather than through.