This is a small example of using CSS transforms to achieve an animated rotation effect on a div
when you hover over the div
.
Modify the code so that:
- …when you hover, the
div
s also get nudged a little to the right or left - …when you hover, the
div
s also fade from one background color to another, but over a different time period than the rotation animation (i.e. something other than0.6s
) - …the animations use a different easing function
- MDN's page on CSS transforms and transitions
- This tutorial on CSS rotations and transformations.