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
lihaoquan
12,045 PointsHow is this CSS effect accomplished?
I saw this website, the big blue rectangle div ( with text : 45000 professionnels formes ) has a CSS effect that makes it look like its floating and is able to tilt based on where your cursor is on. How is this achieved?
1 Answer
Damien Watson
27,419 PointsHi, it uses 3d transformations. Javascript to get the mouse offset and apply CSS 'matrix3D' rotations.
W3schools has a write up on 3D transforms which are a bit easier to apply than 'matrix3D'.
Damien Watson
27,419 PointsDamien Watson
27,419 PointsIt is actually quite complicated, but I found this explanation which you can look into if you have the time.
Understanding CSS 3D Transforms
lihaoquan
12,045 Pointslihaoquan
12,045 PointsThanks