HTML & CSS Masterclass Tutorial

Comprehensive guide to modern HTML and CSS development.

Transforms

CSS Transforms

The transform property allows you to visually manipulate elements in 2D or 3D space without affecting the normal document flow.

Common Transform Functions:

  • translate(x, y): Moves the element from its current position. Very useful for perfect centering.
  • scale(n): Increases or decreases the size of an element (e.g., 1.5 is 150%).
  • rotate(deg): Rotates the element clockwise or counter-clockwise (e.g., 45deg).
  • skew(x, y): Skews the element along the X and Y axes.

Combining transform with transition creates powerful, hardware-accelerated animations!

Try It Yourself

Edit the code below and click Run to see the result live.

Source Code
Result
Topics