2024年7月18日 00:37
What is the purpose of the CSS transform property? Give examples of its usage.
The CSS transform property is used to apply transformations to elements such as scaling, rotating, skewing, or translating (moving) them. Examples of its usage include:
- Scaling an element: "transform: scale(1.2);" increases the element's size by 20%.
- Rotating an element: "transform: rotate(45deg);" rotates the element by 45 degrees clockwise.
- Translating an element: "transform: translate(50px, 50px);" moves the element 50 pixels to the right and 50 pixels down.