CSS Transform Apply 2D or 3D Transformations to an Element: Translate | Scale | Rotate | Skew
Move an element relative to its current position. Also moves content. Translate Move an element relative to its current position. Also moves content.
Translate transform: translate(x); transform: translate(x, y); Move horizontally. Amount in px or %, positive or negative values Translate transform: translate(x); transform: translate(x, y); transform:translateX(x); transform:translateY(y); Move horizontally & vertically Move horizontally Move vertically
Make an element bigger or smaller. Stretches content. Scale Make an element bigger or smaller. Stretches content.
Scale transform: scale(amt); transform: scale(x, y); Change x & y dimensions by this value. Decimal representation of amount. Ex: 1.5 = 150% bigger Scale transform: scale(amt); transform: scale(x, y); transform: scaleX(amt); transform: scaleY(amt); Scale x & y by separate amounts Scale x (stretch horizontally) Scale y (stretch vertically)
Turn an element along one or more of its axes. Rotates content too. y-axis x-axis Rotate z-axis Turn an element along one or more of its axes. Rotates content too.
Rotate transform: rotate(amt); transform: rotateX(amt); Amount in degrees (ex: 10deg) Positive (clockwise) or Negative (counterclockwise) Rotate transform: rotate(amt); transform: rotateX(amt); transform: rotateY(amt); transform: rotateZ(amt); Rotate around x-axis Rotate around y-axis Rotate around z-axis
Skew an element along x or y axis or both. Skews content too. X & Y Skew an element along x or y axis or both. Skews content too.
Amount in degrees (ex: 10deg) X and y can be different amounts Skew transform: skew(x, y); transform: skewX(amt); transform: skewY(amt); Skew along x-axis Skew along y-axis