Presentation is loading. Please wait.

Presentation is loading. Please wait.

CSS Transform Apply 2D or 3D Transformations to an Element: Translate | Scale | Rotate | Skew.

Similar presentations


Presentation on theme: "CSS Transform Apply 2D or 3D Transformations to an Element: Translate | Scale | Rotate | Skew."— Presentation transcript:

1 CSS Transform Apply 2D or 3D Transformations to an Element: Translate | Scale | Rotate | Skew

2 Move an element relative to its current position. Also moves content.
Translate Move an element relative to its current position. Also moves content.

3 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

4 Make an element bigger or smaller. Stretches content.
Scale Make an element bigger or smaller. Stretches content.

5 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)

6 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.

7 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

8 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.

9 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


Download ppt "CSS Transform Apply 2D or 3D Transformations to an Element: Translate | Scale | Rotate | Skew."

Similar presentations


Ads by Google