The CSS transform property allows you to rotate, scale, move, or skew elements. This creates dynamic and eye-catching effects without changing the element’s actual size or position.
In the following example, we rotate a box by 45 degrees on hover. By adding a transition, the rotation happens gradually.
The example demonstrates the use of rotate(), which rotates an element by a specified angle.
Transform can modify elements in several ways: rotation, scaling, translation, and skewing. These can also be combined for complex effects.
Function | Description |
---|---|
rotate() | Rotates the element by a given degree (e.g., rotate(45deg)). |
scale() | Scales the element up or down (e.g., scale(1.5)). |
translate() | Moves the element along the X and Y axes (e.g., translate(50px, 20px)). |
skew() | Skews the element along the X and Y axes (e.g., skew(20deg, 10deg)). |
Transform is a powerful tool for visually manipulating elements. Here are some tips:
Please sign in to ask Lara about CSS Transform.
Select Language
Set theme
© 2025 ReadyTools. All rights reserved.