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
Lucas Krause19,924 Points
rotate() vs. rotateZ()
Why is Guil using
rotate() in the
rock-boat animation but
rotateZ() in the
What's the difference between these two transform functions? I already read the MDN documentation on transform functions but unfortunately it didn't help me a lot.
Sure, I know that
rotateZ() is more common when using 3D transformations, but when toggling the comments in the following JSFiddles I can't see any difference between the results:
Peter Szerzo22,661 Points
They do the exact same thing. rotateZ means 'rotate about the Z axis', and the Z axis points 'outwards from your screen'. [[ you use the same z-axis when you define a property called the z-index. If two elements overlap and one of them has a higher z-index, that one will be in the front ]]
Here is a w3c link that explains more, including browser support: http://www.w3schools.com/css/css3_3dtransforms.asp